From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0001.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0003.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0002.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0001.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0004.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0003.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0002.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0001.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0001.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0005.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0004.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0004.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0003.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0003.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0006.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0005.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0005.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0004.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0004.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0007.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0006.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0006.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0005.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0005.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0008.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0007.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0007.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0006.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0006.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment.html From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0009.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0008.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0008.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0007.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0007.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0001.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0010.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0009.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0009.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0008.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0008.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0003.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0011.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0010.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0010.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0009.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0009.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0004.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0001.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0001.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0012.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0011.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0011.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0010.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0010.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0005.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0003.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0002.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment.html From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0013.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0012.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0012.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0011.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0011.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0006.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0004.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0003.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0001.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0001.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0001.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0014.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0013.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0013.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0012.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0012.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0007.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0005.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0004.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0002.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0002.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0002.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0001.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0015.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0014.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0014.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0013.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0013.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0008.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0006.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0005.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0003.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0003.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0003.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0002.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0016.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0015.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0015.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0014.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0014.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0009.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0007.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0006.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0004.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0004.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0004.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0003.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0017.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0016.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0016.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0015.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0015.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0010.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0008.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0007.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0005.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0005.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0005.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0004.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0018.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0017.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0017.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0016.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0016.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0011.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0009.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0008.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0006.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0006.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0006.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0005.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0019.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0018.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0018.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0017.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0017.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0012.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0010.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0009.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0008.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0008.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0008.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0007.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0001.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0020.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0019.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0019.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0018.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0018.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0013.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0011.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0010.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0009.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0009.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0009.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0008.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0003.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0002.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment.html From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0021.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0020.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0020.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0019.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0019.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0014.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0012.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0011.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0010.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0010.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0010.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0009.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0004.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0003.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0001.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0001.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0001.html From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0022.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0021.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0021.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0020.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0020.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0015.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0013.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0012.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0011.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0011.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0011.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0010.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0005.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0004.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0003.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0003.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0002.html From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0023.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0022.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0022.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0021.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0021.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0016.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0014.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0013.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0012.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0012.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0012.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0011.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0006.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0005.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0004.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0004.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0003.html From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0024.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0023.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0023.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0022.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0022.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0017.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0015.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0014.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0013.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0013.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0013.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0012.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0007.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0006.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0005.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0005.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0004.html From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0025.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0024.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0024.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0023.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0023.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0018.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0016.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0015.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0014.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0014.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0014.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0013.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0008.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0007.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0006.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0006.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0005.html From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0026.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0025.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0025.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0024.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0024.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0019.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0017.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0016.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0015.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0015.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0015.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0014.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0009.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0008.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0007.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0007.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0006.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0027.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0026.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0026.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0025.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0025.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0020.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0018.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0017.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0016.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0016.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0016.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0015.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0010.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0009.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0008.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0008.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0007.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0028.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0027.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0027.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0026.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0026.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0021.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0019.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0018.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0017.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0017.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0017.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0016.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0011.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0010.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0009.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0009.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0008.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0029.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0028.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0028.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0027.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0027.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0022.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0020.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0019.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0018.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0018.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0018.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0017.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0012.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0011.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0010.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0010.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0009.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0030.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0029.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0029.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0028.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0028.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0023.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0021.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0020.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0019.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0019.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0019.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0018.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0013.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0012.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0011.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0011.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0010.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0031.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0030.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0030.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0029.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0029.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0024.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0022.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0021.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0020.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0020.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0020.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0019.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0014.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0013.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0012.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0012.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0011.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0032.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0031.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0031.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0030.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0030.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0025.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0023.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0022.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0021.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0021.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0021.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0020.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0015.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0014.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0013.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0013.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0012.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0033.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0032.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0032.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0031.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0031.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0026.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0024.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0023.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0022.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0022.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0022.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0021.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0016.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0015.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0014.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0014.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0013.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0034.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0033.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0033.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0032.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0032.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0027.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0025.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0024.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0023.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0023.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0023.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0022.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0017.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0016.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0015.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0015.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0014.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0035.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0034.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0034.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0033.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0033.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0028.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0026.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0025.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0024.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0024.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0024.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0023.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0018.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0017.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0016.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0016.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0015.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0036.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0035.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0035.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0034.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0034.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0029.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0027.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0026.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0025.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0025.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0025.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0024.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0019.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0018.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0017.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0017.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0016.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0037.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0036.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0036.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0035.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0035.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0030.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0028.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0027.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0026.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0026.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0026.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0025.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0020.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0019.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0018.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0018.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0017.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0038.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0037.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0037.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0036.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0036.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0031.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0029.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0028.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0027.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0027.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0027.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0026.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0021.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0020.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0019.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0019.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0018.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0039.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0038.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0038.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0037.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0037.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0032.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0030.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0029.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0028.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0028.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0028.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0027.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0022.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0021.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0020.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0020.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0019.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0040.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0039.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0039.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0038.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0038.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0033.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0031.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0030.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0029.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0029.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0029.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0028.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0023.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0022.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0021.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0021.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0020.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0041.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0040.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0040.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0039.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0039.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0034.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0032.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0031.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0030.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0030.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0030.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0029.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0024.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0023.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0022.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0022.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0021.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0042.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0041.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0041.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0040.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0040.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0035.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0033.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0032.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0031.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0031.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0031.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0030.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0025.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0024.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0023.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0023.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0022.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0043.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0042.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0042.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0041.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0041.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0036.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0034.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0033.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0032.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0032.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0032.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0031.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0026.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0025.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0024.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0024.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0023.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0044.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0043.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0043.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0042.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0042.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0037.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0035.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0034.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0033.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0033.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0033.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0032.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0027.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0026.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0025.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0025.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0024.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0045.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0044.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0044.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0043.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0043.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0038.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0036.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0035.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0034.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0034.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0034.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0033.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0028.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0027.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0026.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0026.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0025.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0046.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0045.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0045.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0044.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0044.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0039.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0037.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0036.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0035.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0035.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0035.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0034.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0029.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0028.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0027.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0027.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0026.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0047.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0046.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0046.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0045.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0045.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0040.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0038.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0037.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0036.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0036.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0036.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0035.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0030.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0029.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0028.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0028.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0027.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0048.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0047.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0047.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0046.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0046.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0041.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0039.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0038.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0037.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0037.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0037.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0036.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0031.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0030.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0029.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0029.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0028.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0049.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0048.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0048.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0047.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0047.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0042.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0040.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0039.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0038.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0038.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0038.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0037.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0032.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0031.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0030.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0030.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0029.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0050.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0049.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0049.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0048.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0048.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0043.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0041.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0040.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0039.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0039.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0039.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0038.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0033.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0032.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0031.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0031.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0030.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0051.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0050.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0050.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0049.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0049.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0044.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0042.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0041.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0040.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0040.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0040.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0039.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0034.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0033.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0032.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0032.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0031.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0052.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0051.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0051.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0050.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0050.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0045.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0043.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0042.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0041.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0041.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0041.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0040.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0035.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0034.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0033.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0033.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0032.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0053.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0052.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0052.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0051.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0051.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0046.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0044.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0043.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0042.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0042.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0042.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0041.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0036.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0035.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0034.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0034.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0033.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0054.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0053.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0053.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0052.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0052.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0047.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0045.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0044.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0043.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0043.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0043.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0042.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0037.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0036.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0035.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0035.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0034.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0055.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0054.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0054.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0053.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0053.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0048.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0046.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0045.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0044.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0044.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0044.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0043.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0038.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0037.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0036.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0036.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0035.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0056.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0055.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0055.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0054.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0054.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0049.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0047.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0046.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0045.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0045.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0045.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0044.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0039.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0038.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0037.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0037.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0036.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0057.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0056.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0056.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0055.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0055.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0050.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0048.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0047.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0046.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0046.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0046.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0045.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0040.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0039.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0038.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0038.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0037.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0058.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0057.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0057.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0056.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0056.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0051.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0049.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0048.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0047.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0047.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0047.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0046.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0041.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0040.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0039.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0039.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0038.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0059.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0058.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0058.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0057.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0057.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0052.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0050.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0049.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0048.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0048.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0048.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0047.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0042.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0041.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0040.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0040.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0039.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0060.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0059.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0059.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0058.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0058.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0053.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0051.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0050.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0049.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0049.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0049.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0048.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0043.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0042.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0041.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0041.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0040.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0061.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0060.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0060.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0059.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0059.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0054.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0052.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0051.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0050.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0050.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0050.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0049.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0044.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0043.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0042.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0042.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0041.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0062.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0061.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0061.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0060.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0060.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0055.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0053.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0052.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0051.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0051.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0051.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0050.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0045.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0044.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0043.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0043.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0042.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0063.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0062.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0062.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0061.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0061.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0056.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0054.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0053.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0052.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0052.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0052.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0051.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0046.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0045.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0044.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0044.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0043.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0064.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0063.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0063.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0062.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0062.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0057.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0055.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0054.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0053.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0053.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0053.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0052.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0047.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0046.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0045.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0045.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0044.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0065.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0064.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0064.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0063.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0063.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0058.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0056.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0055.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0054.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0054.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0054.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0053.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0048.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0047.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0046.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0046.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0045.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0066.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0065.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0065.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0064.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0064.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0059.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0057.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0056.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0055.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0055.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0055.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0054.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0049.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0048.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0047.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0047.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0046.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0067.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0066.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0066.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0065.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0065.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0060.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0058.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0057.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0056.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0056.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0056.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0055.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0050.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0049.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0048.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0048.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0047.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0068.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0067.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0067.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0066.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0066.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0061.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0059.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0058.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0057.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0057.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0057.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0056.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0051.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0050.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0049.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0049.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0048.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0069.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0068.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0068.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0067.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0067.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0062.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0060.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0059.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0058.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0058.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0058.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0057.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0052.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0051.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0050.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0050.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0049.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0070.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0069.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0069.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0068.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0068.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0063.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0061.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0060.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0059.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0059.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0059.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0058.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0053.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0052.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0051.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0051.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0050.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0071.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0070.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0070.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0069.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0069.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0064.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0062.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0061.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0060.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0060.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0060.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0059.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0054.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0053.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0052.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0052.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0051.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0072.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see: How can I use Lock Files with rxtx? in INSTALL I added myself to the uucp group like the warning says but it did not remove this warning. I was not able to find the 'How can I use Lock Files with rxtx? in INSTALL' either, so to circumvent this issue for the time being I ran the application via the commandline as root and got the following output $ sudo java src.SerialTest Exception in thread "main" java.lang.UnsatisfiedLinkError: com.sun.comm.SunrayInfo.isSessionActive()Z at com.sun.comm.SunrayInfo.isSessionActive(Native Method) at com.sun.comm.Portmapping.registerCommPorts(Portmapping.java:155) at com.sun.comm.Portmapping.refreshPortDatabase(Portmapping.java:100) at javax.comm.CommPortIdentifier.(CommPortIdentifier.java:138) at src.Serial.loadPortList(Serial.java:173) at src.Serial.(Serial.java:59) at src.SerialTest.main(SerialTest.java:9) I'm a bit confused as to why the program is using com.sun.comm.SunrayInfo (I'm assuming this is Sun java 6 stuff) when the javax.comm.properties file says to use the gnu.io.RXTXCommDriver. If anyone has any advice as to how to get this working it would be greatly appreciated. Thank you, Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/d0a4b7b2/attachment-0071.html From tjarvi at qbang.org Sun Mar 2 17:36:11 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 17:36:11 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: On Sun, 2 Mar 2008, Andre-John Mas wrote: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? > > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ > > But I know nothing equivalent for Windows. > > Andre > > This is very good advice for any USB dongle. Often the drivers are updated after the hardware is shipped. My comments are for those vendors that don't offer updates. There was a time when a UART went through very extensive testing before being sold. Part of the testing boardered upon legends with some being standards under very predictable environments. Why? Well, people would pay $500 for a 9600 baud modem and expect it to work with their ISP. The tests for conformance are public. I assume the new chips are tested with them. The drivers? I don't see evidence of such compliance testing. Now people pay $8 for a USB dongle and expect the same level of conformance. This is not the case in reality for obvious economic reasons. I'd even offer that failures not reproducable outside of rxtx are often valid failures. There is no software shipped with any OS that confirms or denys a drivers conformance to standards (POSIX) or conventions (WIN32). Just because something works outside of rxtx does not make the behavior or the error confirmed with dongles. Nothing in the rxtx 'charter' says behave like program 'x.' We only need to support POSIX. Everything else is a bug in the drivers or our following of POSIX (there are a couple known but not this). > On 2-Mar-08, at 15:29 , Trent Jarvi wrote: > >>> Do I have a chance to use an USB-converter in a stable way? >> >> To be honest, no. USB-converters vary too much to make a blanket >> statement such as that. I'm sure their hardware is fine and almost all >> fall into two chipsets. But ever device comes with a CD/driver/... Often >> you will not be able to figure out who wrote the driver. >> >> Some brands have better drivers. Some behave very well. Usually, if you >> recognize the name brand, the driver is OK. >> >> Try Keyspan, IOGear, ... they should behave well and may even listen to >> bug reports. If you are trying a generic solution with the driver >> outsourced, good luck. I doubt it is the chipset that is the problem in >> the end. >> >> I think it would be reasonable for rxtx.org to start a blacklist of >> products not supported if there are specific examples of why, we reported >> it to the vendor and followed up with testing when asked. >> >> -- >> Trent Jarvi >> tjarvi at qbang.org >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx From vragon2 at gmail.com Sun Mar 2 23:09:21 2008 From: vragon2 at gmail.com (John Vogel) Date: Mon, 3 Mar 2008 00:09:21 -0600 Subject: [Rxtx] Is there a way disable the following message from being printed? Message-ID: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Is there a way disable the following message from being printed? Stable Library ========================================= Native lib Version = RXTX-2.1-7 Java lib Version = RXTX-2.1-7 vragon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080303/d00470e4/attachment-0071.html From lyon at docjava.com Mon Mar 3 06:08:52 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Mon, 03 Mar 2008 08:08:52 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: Hi All, I have been using intel mac/ppc for RXTX (Howard Amos asked about this). http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp has the test application. It works for Linux/x86 and Windows/x86 too. Ciao, - Doug From ajmas at sympatico.ca Mon Mar 3 18:49:55 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:49:55 -0500 Subject: [Rxtx] Is there a way disable the following message from being printed? In-Reply-To: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: On 3-Mar-08, at 01:09 , John Vogel wrote: > Is there a way disable the following message from being printed? > > Stable Library > ========================================= > Native lib Version = RXTX-2.1-7 > Java lib Version = RXTX-2.1-7 Yes, by specifying the following system property, and setting the value to "true" gnu.io.rxtx.NoVersionOutput Andre From ajmas at sympatico.ca Mon Mar 3 18:54:47 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 3 Mar 2008 20:54:47 -0500 Subject: [Rxtx] intel mac/ppc In-Reply-To: References: Message-ID: <22C77B82-A971-4E26-A6D1-5DF186199F4C@sympatico.ca> On 3-Mar-08, at 08:08 , Dr. Douglas Lyon wrote: > Hi All, > I have been using intel mac/ppc > for RXTX (Howard Amos asked about this). > http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp > has the test application. > It works for Linux/x86 and Windows/x86 too. I am a little confused. What does this application use RxTx for? Andre From pl78 at katamail.com Tue Mar 4 01:10:27 2008 From: pl78 at katamail.com (pl) Date: Tue, 04 Mar 2008 09:10:27 +0100 Subject: [Rxtx] disable lock files In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <47CD03F3.5060003@katamail.com> An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/d4cb74ed/attachment-0070.html From boesi.josi at gmx.net Tue Mar 4 05:28:16 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Tue, 04 Mar 2008 13:28:16 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: <47CD4060.20608@gmx.net> Andre-John Mas schrieb: > Hi, > > If there is any way to reproduce your observations outside of rxtx, > then you could use that to file a bug request with Prolific. In > fact, have you tried the driver provided on Prolific's web site, > as opposed to the one bundled with the device? Wit XP I've always used the driver from the Prolifics site. Till today I used version 2.0.2.1. Today I updated to 2.0.2.8. But Prolific doesn't provide a driver for Vista. I don't know where I got it first, it was version 1.5 and manufacturer was Prolific (indicated in the device manager). But the "driver update" found version 2.0.2.1 from 4. nov. 2005 and this is what I'm using now with Vista. > On the Mac is there is an open source implementation of the driver, > which is not the same one as provided by the manufacturer: > > http://sourceforge.net/projects/osx-pl2303/ Sounds really interesting but unfortunately I don't have a mac ... if somebody would port it to Windows[*] - I'd be very very glad to beta-test it *G* [*] That goes far beyond my current knowledge cu boesi -- No matter where you are. Everyone is always connected. From pascal.brillard at elomobile.com Tue Mar 4 06:05:49 2008 From: pascal.brillard at elomobile.com (Pascal BRILLARD) Date: Tue, 4 Mar 2008 14:05:49 +0100 Subject: [Rxtx] 125000 baudrate Message-ID: Hy, I am trying to open a rs232 port with a special speed of 125000 bauds without success. When I change the speed to 115200 I don't have problem. In fact, I am using Aspycom to control the data written and read and it tells me that the speed is set to 9600 baud. So, is-it possible to open the port at 125000 bauds and if yes, how can I do it ? Thanks in advance for your reply. Pascal -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080304/9b314599/attachment-0070.html From marcopar at gmail.com Tue Mar 4 06:41:45 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Tue, 04 Mar 2008 14:41:45 +0100 Subject: [Rxtx] Serial Comm on FTDI device In-Reply-To: <000401c87b00$2e4290f0$8ac7b2d0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> Message-ID: <47CD5199.3030805@gmail.com> Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. From lyon at docjava.com Tue Mar 4 07:57:36 2008 From: lyon at docjava.com (Dr. Douglas Lyon) Date: Tue, 04 Mar 2008 09:57:36 -0500 Subject: [Rxtx] webstart and serial ports Message-ID: Hi All, The JAddressbook program at: http://show.docjava.com:8086/book/cgij/code/jnlp/addbk.JAddressBook.Main.jnlp automatically uses the serial ports to dial the phone, via a modem. It is a webstart application. Just go to Edit:Prefs:Serial Port setup... and Edit:Prefs:Dial setup... you can use the program to intelligently decide on toll-free numbers and local numbers. The modem, on a mac, uses a usb->serial dongle (like Keyspan or PortIO) to do the modem communication. This is great for getting through voice jail; (please enter your account number, please enter your pin, enter your home phone, etc.). For example, on ameritrade, you dial in: 8006693900,,,,0,,(long account number)#,,,(pin number)# Also, it is very good for using a calling card. You insert pauses with commas in the phone number, to rig the dialer to do the right thing at the right time. For example, on AT&T pre-paid cards you use: 1800-603-7403,,,(long pin number) So, break out your old modem, we now have a good use for it! Even slow modems, dial the phone fast!! Cheers! - DL From Martin.Oberhuber at windriver.com Tue Mar 4 09:06:27 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Tue, 4 Mar 2008 17:06:27 +0100 Subject: [Rxtx] Is there a way disable the following message from beingprinted? In-Reply-To: References: <14a6fbc20803022209i2cd5642fxe40c610d126da140@mail.gmail.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804B5C97E@ism-mail03.corp.ad.wrs.com> > Yes, by specifying the following system property, and setting the > value to "true" > > gnu.io.rxtx.NoVersionOutput ... but only if you use an RXTX CVS Snapshot which is newer than 2.1-7r2 -- the feature was added in RXTXCommDriver.java version 1.16.2.55 which was after release 2.1-7r2 What you can do is get RXTX-2.1-7r4 from the Eclipse Plugin site: http://rxtx.qbang.org/eclipse/downloads/ It includes the patch that makes noVersionOutput work. Note, though, that on linux you'll still see this printed to stdout from SerialImp.c v1.46.2.187: Experimental: JNI_OnLoad called. This printout was removed on 8-May-2006 in SerialImp.c v1.46.2.188 but nobody compiled a new native Lib with that change yet. Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm > -----Original Message----- > From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] > On Behalf Of Andre-John Mas > Sent: Dienstag, 04. M?rz 2008 02:50 > To: John Vogel > Cc: rxtx at qbang.org > Subject: Re: [Rxtx] Is there a way disable the following > message from beingprinted? > > > On 3-Mar-08, at 01:09 , John Vogel wrote: > > > Is there a way disable the following message from being printed? > > > > Stable Library > > ========================================= > > Native lib Version = RXTX-2.1-7 > > Java lib Version = RXTX-2.1-7 From gergg at cox.net Tue Mar 4 09:42:37 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 04 Mar 2008 10:42:37 -0600 Subject: [Rxtx] ImportError: cannot import name CommPortIdentifier In-Reply-To: <47C7D71C.50608@katamail.com> References: <47C730AE.1070101@katamail.com> <06BA3262D918014F9183B66425D5A8D425240DE578@no-sv-03.ketech.local> <47C7D71C.50608@katamail.com> Message-ID: <47CD7BFD.70807@cox.net> pl wrote: > thanks Michael, > > On Windows > 1) i put RXTX.comm in ..java/lib/ext > 2) i put rxtxserial.dll in ..java/lib > On Linux > 1) RXTXcomm.jar in /jre/lib/ext (under java) > 2) librxtxSerial.so in /jre/lib/[machine type] > > Now my application work; > *but the problem remains: how do the application porting from linux to > Windows/MAC/Solaris without manually copy the dll and rxtx.comm ?* > > My application will be distributed with jar What I usually do to solve this problem is put these files into my jar under a sub-directory, such as /resources, and then copy the dll into the users home directory /.myappname/xxx.dll if it is not already there, and then do the load library from there. I don't have access to my latest instance of doing this to copy from, but from memory it was something like the following. Then in the startup of your application, you would just do public static void main( String args[] ) { ... MyLoader.loadDLL( "rxtxserial.dll" ); ... } ============================================== public class MyLoader { public static void loadDLL( String dllName ) { File home = System.getProperty("user.home")+"/myappname"; File dll = new File( home, dllName ); // Check if already copied into place if( dll.isFile() == false || dll.exists() == false ) { // Copy the resource out of the jar to the filesystem. InputStream is = MyLoader.class.getResourceAsStream( "/resources/"+dllName ); try { FileOutputStream os = new FileOutputStream( dll ); try { byte[]data = new byte[4096]; int cnt; while( ( cnt = is.read(data) ) > 0 ) { os.write( data, 0, cnt ); } } finally { os.close(); } } finally { is.close(); } } // Load it. System.load( dll.toString() ); } } From fexcodcc at gmail.com Tue Mar 4 10:13:59 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:13:59 +0000 Subject: [Rxtx] RXTX Release Message-ID: <3127f100803040913v2e61f590tdd0aab5266bb6675@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From fexcodcc at gmail.com Tue Mar 4 10:15:56 2008 From: fexcodcc at gmail.com (Fexco DCC) Date: Tue, 4 Mar 2008 17:15:56 +0000 Subject: [Rxtx] Next RXTX release Message-ID: <3127f100803040915k2f1cdfa2ga4fdec580d23a8c@mail.gmail.com> Hi, Is there a schedule for the next release of RXTX? 2.1-7r2 has been available for a while now. The company I work for have been waiting for the next stable release as the CVS version has fixes we need. We cannot use the CVS version for a production level system. Thanks Paul From benedums at comcast.net Tue Mar 4 11:31:02 2008 From: benedums at comcast.net (Sailin) Date: Tue, 4 Mar 2008 12:31:02 -0600 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <47CD5199.3030805@gmail.com> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> Message-ID: <001601c87e25$e6dd4650$b497d2f0$@net> The Latency Timer of the device is set to 16 which is in milliseconds, and the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the maximum value is 255... so 750 msec is not possible. Also note that the device works just fine when controlled by a Win32 app. With a Java RXTX app it is able to connect and send data but gets no response or any errors. Sailin Benedum -----Original Message----- From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of marcopar at gmail.com Sent: Tuesday, March 04, 2008 7:42 AM To: rxtx at qbang.org Subject: Re: [Rxtx] Serial Comm on FTDI device Sailin wrote: > > Is there something special I need to do to configure RXTX to work with > FTDI devices? > > > > Has anyone had a similar problem or have any suggestions on what may be > wrong? when i have problems with communication through a ftdi device i follow these steps: - download and install ftdi driver from http://www.ftdichip.com/ - when the adapter is plugged a com appears in the device list - properties->port settings-> advanced->latency timer reduce that value, i use 3/4 usually. please note that i usually don't use event notification so maybe this solution does not apply to your case. _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From marcopar at gmail.com Wed Mar 5 02:07:51 2008 From: marcopar at gmail.com (marcopar at gmail.com) Date: Wed, 05 Mar 2008 10:07:51 +0100 Subject: [Rxtx] USB Serial on FTDI device not working In-Reply-To: <001601c87e25$e6dd4650$b497d2f0$@net> References: <000401c87b00$2e4290f0$8ac7b2d0$@net> <47CD5199.3030805@gmail.com> <001601c87e25$e6dd4650$b497d2f0$@net> Message-ID: <47CE62E7.1010403@gmail.com> Sailin wrote: > The Latency Timer of the device is set to 16 which is in milliseconds, and > the lowest value available is 1. By 3/4 do you mean 3/4 seconds? If so, the > maximum value is 255... so 750 msec is not possible. i mean 3 or 4 msec. > Also note that the device works just fine when controlled by a Win32 app. > i know but this is the only problem i had with ftdi chips. try and see if it helps, it won't hurt. > With a Java RXTX app it is able to connect and send data but gets no > response or any errors. your using events, double check you've correctly registerered the listener but remember that i have never used that part of the API so i can be wrong. ciao From boesi.josi at gmx.net Wed Mar 5 08:02:40 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Wed, 05 Mar 2008 16:02:40 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <47CEB610.2000104@gmx.net> Hi Yesterday I had a long talk with the manufacturer of the device and he gave me some hints. The loss of exact 9 bytes has something to do with an 8-byte-buffer that gets corrupted. Probably the most useful hint was to increase the size of any buffer I could find. So I searched through all the docs and the following lines of code came out (I just tried anything I found and didn't check which line is really useful): // rsConn is an instance of RXTXPort rsConn.enableReceiveTimeout(1000); rsConn.enableReceiveThreshold(10); rsConn.setInputBufferSize(4096); // rsThread is the Thread that reads the bytes ... rsThread.setPriority(Thread.MAX_PRIORITY); Question 1: What's the unit of the buffer size? Byte? And is the buffer size really 0 (the buffer doesn't exist) if this function isn't called? Result: On Vista I didn't receive any error in 12 hours. XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position in the string and at next it gets an 'A' - this never happens on my Vista notebook and the frequency hasn't changed on XP after the code modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of EOS occur - altogether 92 EOSs in 71 minutes. But maybe not the OS is the problem but rather all the simultaneously running programs on this machine... Question 2: Shouldn't there a hint to these functions exist in the general tutorials? This could saved me some days ... but eventually I learned some things and optimized the code ... cu boesi PS: Ahh and the new fast device works with the USB converter too. This was a problem with TuTTY. -- Flat is better than nested. The Zen of Python #5, by Tim Peters From tjarvi at qbang.org Wed Mar 5 18:47:07 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 5 Mar 2008 18:47:07 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CEB610.2000104@gmx.net> References: <47CA7433.8060606@gmx.net> <47CEB610.2000104@gmx.net> Message-ID: On Wed, 5 Mar 2008, Alexander 'boesi' B?secke wrote: > Hi > > Yesterday I had a long talk with the manufacturer of the device and he > gave me some hints. > > The loss of exact 9 bytes has something to do with an 8-byte-buffer that > gets corrupted. > > Probably the most useful hint was to increase the size of any buffer I > could find. So I searched through all the docs and the following lines > of code came out (I just tried anything I found and didn't check which > line is really useful): > // rsConn is an instance of RXTXPort > rsConn.enableReceiveTimeout(1000); > rsConn.enableReceiveThreshold(10); > rsConn.setInputBufferSize(4096); > // rsThread is the Thread that reads the bytes ... > rsThread.setPriority(Thread.MAX_PRIORITY); > > Question 1: What's the unit of the buffer size? Byte? And is the buffer > size really 0 (the buffer doesn't exist) if this function isn't called? The inputBufferSize is a noop in rxtx. I never understood what buffer it referred to. Some OS's allow control of a buffer on the hardware. I suspect that that was added by Sun while looking at the w32 API. I assumed at the time that it was referring to a java I/O buffer and thought there are other classes (BufferedInputStream) that could do it better. > > Result: > On Vista I didn't receive any error in 12 hours. > > XP is a bit more unstable: 1. Sometimes it receives 0x00 at any position > in the string and at next it gets an 'A' - this never happens on my > Vista notebook and the frequency hasn't changed on XP after the code > modification. 2. Occasionally a burst (10-20 in less than 20 seconds) of > EOS occur - altogether 92 EOSs in 71 minutes. > > But maybe not the OS is the problem but rather all the simultaneously > running programs on this machine... > > Question 2: Shouldn't there a hint to these functions exist in the > general tutorials? This could saved me some days ... but eventually I > learned some things and optimized the code ... > > > cu boesi > PS: Ahh and the new fast device works with the USB converter too. This > was a problem with TuTTY. > > From Babu.Rengarajan at acs-inc.com Sat Mar 8 18:47:26 2008 From: Babu.Rengarajan at acs-inc.com (Rengarajan, Babu) Date: Sat, 8 Mar 2008 20:47:26 -0500 Subject: [Rxtx] How to reopen the port in case of PortInUseException Message-ID: <0B8AEC9FD1AA884A8DB7ECC95BA367E801C7AB11@tytexu04.sls-tt.acs-inc.com> Hi, I get a PortInUseException because the previous shutdown did not close the port. Is there a way to programmatically close the port and reopen a new connection? I have a Java applet which tries to open a port, whenever I get a PortInUseException I need to restart the applet to get it reconnected. I am also investigating to fix the scenario in which the port is not getting closed but also wanted to handle the PortInUseException and retry for a connection. Any suggestions please I use RXTX-2.1-7 Thanks Babu -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080308/d9740ecb/attachment-0065.html From zamek at vili.pmmf.hu Sun Mar 9 10:10:17 2008 From: zamek at vili.pmmf.hu (zamek) Date: Sun, 9 Mar 2008 17:10:17 +0100 Subject: [Rxtx] high latency time after receive a character Message-ID: <200803091710.17856.zamek@vili.pmmf.hu> Hi All, My problem is that, there is a 5-25 mS delay between the first receiving char and data available signal. I check it with an oscilloscope. When I get a signal (data_avilable), I set and clear rts, and I check it received data and rts. Is there any settings to reduce this delay? I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun java 6.0: (Java(TM) SE Runtime Environment (build 1.6.0-b105) Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) I tried: - ftdi_sio, and 2101 usb-serial driver - test it with 2.6.22.5 and 2.6.24.2 kernel - variable enableReceiveTimeout() values - disableReceiveTimeout() -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From tjarvi at qbang.org Sun Mar 9 10:31:15 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 10:31:15 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: On Sun, 9 Mar 2008, zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? > > I use rxtx (2.1.7r2 from debian package) in Debian gnu linux testing and sun > java 6.0: > (Java(TM) SE Runtime Environment (build 1.6.0-b105) > Java HotSpot(TM) Server VM (build 1.6.0-b105, mixed mode) > > > I tried: > - ftdi_sio, and 2101 usb-serial driver > - test it with 2.6.22.5 and 2.6.24.2 kernel > - variable enableReceiveTimeout() values > - disableReceiveTimeout() > Hi Zoltan, Thats about right. When I tried the same thing in JRE 1.2 days, I saw it took about 8-10 ms. My test was to send a byte when data was available with a loopback. The scope was not calibrated but I assume it was close. I assume thats due to schedualing in the OS and the JRE. You could try playing with thread priorities which may help on the 25 ms side but probably not on the low end. The other option is to investigate real-time options now available in Debian. Without an OS or a JRE, sub MS times should be possible. I do suspect that events are not delivered as fast as our needs sometimes present. They may be tuned for handling mouse movements. I don't know but it is also possible that other events are being processed in the same queue. Are you using a GUI? -- Trent Jarvi tjarvi at qbang.org From netbeans at gatworks.com Sun Mar 9 18:46:41 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 09 Mar 2008 20:46:41 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D484F1.2020706@gatworks.com> Trent Jarvi wrote: > On Sun, 9 Mar 2008, zamek wrote: > >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char > Thats about right. When I tried the same thing in JRE 1.2 days, I saw it > took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not interrupt driven. So I suspect that if an equivalent UNIX Select() function(ality) was made avail, this loop might behave more favorably. SerialImp.c: while( i++ < 5 ) { if(eis.eventflags[SPE_DATA_AVAILABLE] ) { if( port_has_changed_fionread( &eis ) ) { send_event( &eis, SPE_DATA_AVAILABLE, 1 ); } } usleep(1000); } From tjarvi at qbang.org Sun Mar 9 19:44:59 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 9 Mar 2008 19:44:59 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D484F1.2020706@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D484F1.2020706@gatworks.com> Message-ID: On Sun, 9 Mar 2008, U. George wrote: > Trent Jarvi wrote: >> On Sun, 9 Mar 2008, zamek wrote: >> >>> Hi All, >>> >>> My problem is that, there is a 5-25 mS delay between the first receiving >>> char > >> Thats about right. When I tried the same thing in JRE 1.2 days, I saw it >> took about 8-10 ms. My test was to send a byte when data was available > I suppose it has something to do with this loop in > SerialImp.c. This Windoz loop wakes up every 1ms of sleep. It is not > interrupt driven. So I suspect that if an equivalent UNIX Select() > function(ality) was made avail, this loop might behave more favorably. > > SerialImp.c: > while( i++ < 5 ) > { > if(eis.eventflags[SPE_DATA_AVAILABLE] ) > { > if( port_has_changed_fionread( &eis ) ) > { > send_event( &eis, SPE_DATA_AVAILABLE, 1 ); > } > } > usleep(1000); > } > He mentioned using Debian so I don't think win32 select is his problem. The windows native code should also have a select implementation. See serial_select in termios.c which basically does the following: wait = WaitForSingleObject( index->sol.hEvent, 100 ); switch ( wait ) { case WAIT_OBJECT_0: goto end; case WAIT_TIMEOUT: goto timeout; case WAIT_ABANDONED: default: goto fail; } } end: /* You may want to chop this out for lower latency */ usleep(1000); LEAVE( "serial_select" ); return( 1 ); Note that there are 1ms sleeps in the code that could come out. I think you will find they result in a firestorm of events especially when data is available. Notably on Linux/Unix, select will not block while data is available. You will observe high CPU use followed by a nonresponsive GUI when you chop the wrong one out in my experience. Also note that the interest is in eliminating up to 20 ms vs the 1-2 ms that can be trimmed from RXTX so far. I can see another bug in the code you pasted that has been reported as "too many data available events." -- Trent Jarvi tjarvi at qbang.org From gergg at cox.net Mon Mar 10 13:28:00 2008 From: gergg at cox.net (Gregg Wonderly) Date: Mon, 10 Mar 2008 14:28:00 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803091710.17856.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> Message-ID: <47D58BC0.6070500@cox.net> zamek wrote: > Hi All, > > My problem is that, there is a 5-25 mS delay between the first receiving char > and data available signal. I check it with an oscilloscope. > When I get a signal (data_avilable), I set and clear rts, and I check it > received data and rts. > Is there any settings to reduce this delay? You are using a non-realtime operating system that does timesharing amongst the processes running. It will never (let me repeat NEVER) be possible to get a predictable and consistent 'delay' between external events and code running to react to that event. It is possible to get some fairly reasonable differences from the extremes, but they will not be predictable. The realtime Java specification was created to start trying to provide some ability to manage realtime requirements in a Java application. Can you talk more about what the software vs external event relationships are? Maybe there is a different system design that will allow you to solve this problem without needing specific realtime support. Gregg Wonderly From netbeans at gatworks.com Mon Mar 10 14:08:42 2008 From: netbeans at gatworks.com (U. George) Date: Mon, 10 Mar 2008 16:08:42 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: <47D5954A.30307@gatworks.com> > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. I dont think u mean to say "predictable". As between 5 and 25ms is a prediction of the delay. If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get the same delay on a 3ghz redhat/P4 box? Some might predict that the delay should now be in the range of .5 and 2.5ms ( and better ), presuming same conditions. But this wont happen if the system is delay ( usleep(1000) ) driven instead of event/interrupt driven. From tjarvi at qbang.org Mon Mar 10 17:19:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 17:19:30 -0600 (MDT) Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D58BC0.6070500@cox.net> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> Message-ID: On Mon, 10 Mar 2008, Gregg Wonderly wrote: > zamek wrote: >> Hi All, >> >> My problem is that, there is a 5-25 mS delay between the first receiving char >> and data available signal. I check it with an oscilloscope. >> When I get a signal (data_avilable), I set and clear rts, and I check it >> received data and rts. >> Is there any settings to reduce this delay? > > You are using a non-realtime operating system that does timesharing amongst the > processes running. It will never (let me repeat NEVER) be possible to get a > predictable and consistent 'delay' between external events and code running to > react to that event. It is possible to get some fairly reasonable differences > from the extremes, but they will not be predictable. > > The realtime Java specification was created to start trying to provide some > ability to manage realtime requirements in a Java application. > > Can you talk more about what the software vs external event relationships are? > Maybe there is a different system design that will allow you to solve this > problem without needing specific realtime support. > > Gregg Wonderly This is more or less what happens in the native code: while(open) { select(fd); // block until the serial port changes send_events(); // send any events required usleep(1000); // sleep for a MS since data available will not // block. } The above is simplified but is more or less what is going on. In theory an IRQ for the serial port triggers select to break out. Typical Linux like most modern operating systems does not make an guarantees about when the IRQ will be serviced. About every 10 ms? There will also be other interrupts that require servicing. Heavy disk use can cause delays. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 18:37:16 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 20:37:16 -0400 Subject: [Rxtx] NIO & JDK 1.5 Message-ID: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Hi, Thinking along the lines of the discussion of migrating to JDK 1.5, has anyone looked at whether Java Native I/O could benefit the RxTx API anywhere? Andre From j.kenneth.gentle at acm.org Mon Mar 10 19:51:38 2008 From: j.kenneth.gentle at acm.org (Ken Gentle) Date: Mon, 10 Mar 2008 21:51:38 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <47D5954A.30307@gatworks.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> Message-ID: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> I believe the term "deterministic" is where Gregg is headed -- with a non-realtime OS (both Windows and common distributions of Linux included) the response to an event by the OS is "non-deterministic", meaning that it cannot be accurately known for all cases. Yes, you can say that a response within some interval is likely, but it is not guaranteed. In a real-time OS, there are guarantees that a response to a given event will always occur within a known interval. Forgive me for speaking in absolutes, there are, of course, exceptions to all of this and the ultimate answer is, of course, "it depends". Can I qualify that statement any further? ;-) Ken On Mon, Mar 10, 2008 at 4:08 PM, U. George wrote: > > > > You are using a non-realtime operating system that does timesharing > amongst the > > processes running. It will never (let me repeat NEVER) be possible to > get a > > predictable and consistent 'delay' between external events and code > running to > > react to that event. It is possible to get some fairly reasonable > differences > > from the extremes, but they will not be predictable. > > I dont think u mean to say "predictable". As between 5 and 25ms is a > prediction of the delay. > > If I get a delay of 5 and 25ms on a 300mhz redhat/pII box, will I get > the same delay on a 3ghz redhat/P4 box? Some might predict that the > delay should now be in the range of .5 and 2.5ms ( and better ), > presuming same conditions. > > But this wont happen if the system is delay ( usleep(1000) ) driven > instead of event/interrupt driven. > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- J. Kenneth Gentle (Ken) Gentle Software LLC Phone: 484.371.8137 Mobile: 302.547.7151 Email: ken.gentle at gentlesoftware.com Email: j.kenneth.gentle at acm.org www.gentlesoftware.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080310/04d1137d/attachment-0063.html From tjarvi at qbang.org Mon Mar 10 21:41:48 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 10 Mar 2008 21:41:48 -0600 (MDT) Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: On Mon, 10 Mar 2008, Andre-John Mas wrote: > Hi, > > Thinking along the lines of the discussion of migrating to JDK 1.5, > has anyone looked at whether Java Native I/O could benefit the RxTx > API anywhere? > Hi Andre, I did order the book on Java NIO to take a look but it is on backorder. I understand this helps TCPIP also? -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Mon Mar 10 21:58:28 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Mon, 10 Mar 2008 23:58:28 -0400 Subject: [Rxtx] NIO & JDK 1.5 In-Reply-To: References: <8FFEA3B3-3CE6-4936-B2C9-A12BE27E585D@sympatico.ca> Message-ID: <269F0CC7-C8E0-461B-BEA0-60B907AC898F@sympatico.ca> On 10-Mar-08, at 23:41 , Trent Jarvi wrote: > On Mon, 10 Mar 2008, Andre-John Mas wrote: > >> Hi, >> >> Thinking along the lines of the discussion of migrating to JDK 1.5, >> has anyone looked at whether Java Native I/O could benefit the RxTx >> API anywhere? >> > > Hi Andre, > > I did order the book on Java NIO to take a look but it is on > backorder. I understand this helps TCPIP also? I believe so. From my quick look at the IO classes and network classes, it looks like Sun reworked the classes to use Java NIO rather extensively. Andre From zamek at vili.pmmf.hu Tue Mar 11 01:40:56 2008 From: zamek at vili.pmmf.hu (zamek) Date: Tue, 11 Mar 2008 08:40:56 +0100 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <200803110840.56867.zamek@vili.pmmf.hu> hello, I made some tests at the last few days: 1. I tried to use Molnar Ingos's real time linux patch, which was stabilized the response time 5ms +-1 ms. Originally response time was 5-25ms. Measurement: when I was get a data available event I set/clear rts, and I was check it with an oscillosope. The first channel was in RxD, and second channel was in RTS. 2. I was tried a simple native c program to test it, based on this link: http://www.comptechdoc.org/os/linux/programming/c/linux_pgcserial.html On signal handler I set/clear rts. It produced cca 50uS response time with MIngo's rtlinux patch! I think so, I will move my sensitive tasks to native c, and I will communicate to my c program with JNA. Is it a good idea? -- ?thx, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From netbeans at gatworks.com Tue Mar 11 04:44:06 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 11 Mar 2008 06:44:06 -0400 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <200803110840.56867.zamek@vili.pmmf.hu> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> <200803110840.56867.zamek@vili.pmmf.hu> Message-ID: <47D66276.3050203@gatworks.com> > On signal handler I set/clear rts. > > It produced cca 50uS response time with MIngo's rtlinux patch! > > > I think so, I will move my sensitive tasks to native c, and I will communicate > to my c program with JNA. Is it a good idea? > I would. But i would not use the signal/SIGIO feature. u might find that java also wants to catch the SIGIO interrupt ( I'm not sure if it does ) . Instead u might want to try the select() functionality. Should produce the same timing. From gergg at cox.net Tue Mar 11 08:48:35 2008 From: gergg at cox.net (Gregg Wonderly) Date: Tue, 11 Mar 2008 09:48:35 -0500 Subject: [Rxtx] high latency time after receive a character In-Reply-To: <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> References: <200803091710.17856.zamek@vili.pmmf.hu> <47D58BC0.6070500@cox.net> <47D5954A.30307@gatworks.com> <670b66630803101851s6ff2dbb1r31f8318332f47b40@mail.gmail.com> Message-ID: <47D69BC3.4070905@cox.net> Ken Gentle wrote: > I believe the term "deterministic" is where Gregg is headed -- with a > non-realtime OS (both Windows and common distributions of Linux > included) the response to an event by the OS is "non-deterministic", > meaning that it cannot be accurately known for all cases. Yes, you can > say that a response within some interval is likely, but it is not > guaranteed. In a real-time OS, there are guarantees that a response to > a given event will always occur within a known interval. > > Forgive me for speaking in absolutes, there are, of course, exceptions > to all of this and the ultimate answer is, of course, "it depends". Can > I qualify that statement any further? ;-) Thanks for injecting the correct term Ken. Yes, deterministic results are the issue. With a time sharing OS, everything is non-deterministic as Ken says. Nothing is predictable in terms of how events interact with the scheduling system because external events will often queue internal responses that are scheduled using quanta based scheduling instead of realtime constraint based scheduling. With a realtime OS, you can at least make sure that the interrupt handler is entered at a deterministic delay interval. Then, it is up to you to write the code that will react. A realtime OS will use priority based preemption to make sure that such determinism is maintained to the best of its ability. When it can't, it may take evasive action to recover to a sane state. Gregg Wonderly From tjarvi at qbang.org Tue Mar 11 19:15:30 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 11 Mar 2008 19:15:30 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. Message-ID: Anyone with a hotmail account is currently not being sent email. I've contacted hotmail's services to help resolve their problem. Mailman has automatically disabled what appears to be all hotmail accounts. Once they resolve the issue I'll start sending email to hotmail accounts again. Sorry for the inconvenience. -- Trent Jarvi tjarvi at qbang.org From michael.busch at siemens.com Wed Mar 12 02:34:17 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 09:34:17 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Hi, for a serial Modbus communication on Debian Linux we are using RXTX. Once in a while we are facing a strange problem: After writing some bytes to the outputStream obtained from RXTXport.getOutputStream() the method outputStream.flush() blocks infinitely. This blockade lasts until at least one byte is received on this serial interface. At this moment the flush() method returns and all previously written bytes get transmitted on the line. Flow control is set to SerialPort.FLOWCONTROL_NONE and the DTR signal is present on the sender when the blockade appears. It is usually possible to write 8 byte of data and flush() the outputStream for 10 to 20 times without problems. Then suddenly flush() blocks. When the problem is present and I do not call the flush() method the data and any further write() call do not transmit data to the serial line. It seems as if the written bytes are stored in the Linux driver unless something is received on the port. The previously written data then gets send out all at once. Has anybody seen a similar problem and knows a way to solve the issue? Thanks for you help. Michael Busch -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/da254526/attachment-0062.html From zamek at vili.pmmf.hu Wed Mar 12 04:24:06 2008 From: zamek at vili.pmmf.hu (zamek) Date: Wed, 12 Mar 2008 11:24:06 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> Message-ID: <200803121124.06534.zamek@vili.pmmf.hu> hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- From michael.busch at siemens.com Wed Mar 12 07:28:22 2008 From: michael.busch at siemens.com (Busch, Michael) Date: Wed, 12 Mar 2008 14:28:22 +0100 Subject: [Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: <200803121124.06534.zamek@vili.pmmf.hu> References: <0C9BD57BDE7F5947B6E8AF9C655EBD99016D3D2B@khes0e1a.ww001.siemens.net> <200803121124.06534.zamek@vili.pmmf.hu> Message-ID: <0C9BD57BDE7F5947B6E8AF9C655EBD990170802C@khes0e1a.ww001.siemens.net> Hi Zamek, thanks for the tip. I will have a closer look at jamod. But our project is already pretty far grown and it might not be impossible for me to do a change in the concept with affordable effort. Michael hi, Ezzel a d?tummal: Wednesday 12 March 2008 09.34.17 Busch, Michael ezt ?rta: > for a serial Modbus communication on Debian Linux we are using RXTX. I use modbus on debian too, but I using Jamod for modbus. It is an excellent tool. I never seen this error with jamod. http://jamod.sourceforge.net/ -- bye, ?---------------------------------- ?Zoltan Zidarics programmer ?PTE-PMMFK H-7621 Pecs, Boszorkany u. 2. Hungary ?E-Mail: zamek at vili.pmmf.hu ?---------------------------------- _______________________________________________ Rxtx mailing list Rxtx at qbang.org http://mailman.qbang.org/mailman/listinfo/rxtx From dgunawa at gmail.com Wed Mar 12 08:38:34 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 09:38:34 -0500 Subject: [Rxtx] How to use RXTX to connect to Cisco Console/Serial Port Message-ID: <630E0273-310C-4E84-8161-8212CBB705EA@gmail.com> Hi, I tried to use RXTX API to create program that connect to Cisco Console (Serial) port. I have successfully tried the TwoWaySerialComm.java and SimpleReader.java to make two PC talking to each other via their serial port. But I can not get either program receive anything back from the Cisco Console port. I can send text bytes to Cisco Console port and verified that the Cisco Console port receive it, but I never get the response back in serialPort.getInputStream() When I tested using a HyperTerm or TeraTerm everything work fine. I can send text and receive msg back from the Cisco Device. So there is nothing wrong there. I check the program for params setting and they are exactly what the params should be for Cisco Console port: 8N1 and flow control None Am I missing something here ? Is talking to a device serial port different than connecting two PC together via serial port ? Any help is appreciated. Thanks Dave From howard at qtutrains.com Wed Mar 12 10:25:02 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:25:02 +1300 Subject: [Rxtx] Rxtx] flush() method of RXTXPort output stream blocks In-Reply-To: References: Message-ID: On 12/03/2008, at 9:34 , Michael Busch wrote: > After writing some bytes to the outputStream obtained from > RXTXport.getOutputStream() the method outputStream.flush() blocks > infinitely. Silly suggestion: Don't call flush. The outputStream doesn't appear to be buffered, or at least I don't call flush and my real-time-ish 30 messages per second don't have problems. I have not tried Debian, only Windows, Mac OS X and SUSE. Sorry its not a real answer but might be a good enough work-around for you :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/fd3c90bf/attachment-0061.html From howard at qtutrains.com Wed Mar 12 10:36:56 2008 From: howard at qtutrains.com (Howard) Date: Thu, 13 Mar 2008 05:36:56 +1300 Subject: [Rxtx] Cisco serial port In-Reply-To: References: Message-ID: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> On 12/03/2008, at 9:34 , rDave wrote: > > I tried to use RXTX API to create program that connect to Cisco > Console (Serial) port. > Am I missing something here ? Is talking to a device serial port > different than connecting two PC together via serial port ? > Yes. The control lines. I cannot remember which ones you need, but I seem to remember that a 3-wire lead does not work on a Cisco box. You might need more wires in your cable and/or you might need to set (or clear) RTS and/or DTR You can set your port to FLOWCONTROL_NONE, but the cisco box does (I think) use flow control by default (so RTS and CTS might need connecting, and probably others). Its too many years since I has to figure all this out :-) Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/aeddb785/attachment-0061.html From dgunawa at gmail.com Wed Mar 12 16:43:41 2008 From: dgunawa at gmail.com (David Gunawan) Date: Wed, 12 Mar 2008 17:43:41 -0500 Subject: [Rxtx] Cisco serial port In-Reply-To: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> References: <9191866C-0594-4C2B-B55A-8AB855187A0A@qtutrains.com> Message-ID: <257557EF-1DB1-4F39-BD9D-0A8A6E29A5D8@gmail.com> well, turn out that just changing the flow control from: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_NONE); to: serialPort.setFlowControlMode(SerialPort.FLOWCONTROL_RTSCTS_IN); resolve the problem ....... I should have tried it. The thing is in Cisco doc for connecting to its console serial port, it said to set flow control to NONE, and in HyperTerminal or TeraTerm, I need to set it to NONE too to make it work So, I don;t know why with rxtx API it need to be RTSCTS But, the important thing is it works ....... :-) Thank you for the suggestion. Dave On Mar 12, 2008, at 11:36 AM, Howard wrote: > > On 12/03/2008, at 9:34 , rDave wrote: >> >> I tried to use RXTX API to create program that connect to Cisco >> Console (Serial) port. > >> Am I missing something here ? Is talking to a device serial port >> different than connecting two PC together via serial port ? >> > Yes. The control lines. I cannot remember which ones you need, but I > seem to remember that a 3-wire lead does not work on a Cisco box. > > You might need more wires in your cable and/or you might need to set > (or clear) RTS and/or DTR > > You can set your port to FLOWCONTROL_NONE, but the cisco box does (I > think) use flow control by default (so RTS and CTS might need > connecting, and probably others). Its too many years since I has to > figure all this out :-) > > Howard Amos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080312/a96e4f9b/attachment-0061.html From paolopagano at hotmail.it Thu Mar 13 09:30:41 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Thu, 13 Mar 2008 15:30:41 +0000 Subject: [Rxtx] read Paralle Port Message-ID: Hi everyone, I need to read data from parallel port where is connected a drdaq data logger (it contains a noise sensor and a brightness sensor so their output are db and lux values). I think using rxtx library but I found only examples concerning with pc that send data to a parallel port (for example to a printer) and not cases where pc receives data from this port. Can I resolve my problem with rxtx ? Have you any examples to help me?? Thank you, Regards, Paolo _________________________________________________________________ Ti piace giocare con le lettere? Prova ABCLive! http://messengergiochi.it.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080313/85a9437d/attachment-0060.html From netbeans at gatworks.com Thu Mar 13 10:25:36 2008 From: netbeans at gatworks.com (U. George) Date: Thu, 13 Mar 2008 12:25:36 -0400 Subject: [Rxtx] read Paralle Port In-Reply-To: References: Message-ID: <47D95580.4030005@gatworks.com> paolo pagano wrote: > Hi everyone, > > I need to read data from parallel port where .... send data to a parallel port (for > example to a printer) and not cases where pc receives data from this port. > Can I resolve my problem with rxtx ? If you can overcome the hardware issue, then u can. The parallel port ( as its modernly defined ) has 3 modes of operating. The old-fashion'd way was to (uni-directionally ) send out the data port, and wait for the strobe to say that the byte was captured, and can send another. Later ( date??? ) those parallel ports were designed to be bi-directional in terms of sending data. I think 2 more modes of bahavior was created. There are some BIOS's that have the feature in which you can set the way the parallel port is/are to behave. Probably WIKI can give details on how each will behave. If your parallel port does not support bi-directional data transfers ( which probaly means u are using a machine from the 70's or 80's ), then its most like that you have that capacity. The commapi for the parallel ports should also have flags to enable one or the other (LPT_MODE_EPP, LPT_MODE_ECP, ... ). Please refer to the parallel port WIKI and modes EPP and ECP. I suspect once you set the proper mode for your computer & device, then I think everything should work much like the serial port i/o ( ie obtain an inputstream, an outputstream, and read and write data ). This is how its suppose to happen ( ie my experience is mainly with serial I/O ). From tjarvi at qbang.org Sat Mar 15 09:47:02 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sat, 15 Mar 2008 09:47:02 -0600 (MDT) Subject: [Rxtx] All of hotmail.com is currently blocked. In-Reply-To: References: Message-ID: On Tue, 11 Mar 2008, Trent Jarvi wrote: > > Anyone with a hotmail account is currently not being sent email. I've > contacted hotmail's services to help resolve their problem. Mailman has > automatically disabled what appears to be all hotmail accounts. > > Once they resolve the issue I'll start sending email to hotmail accounts > again. > > Sorry for the inconvenience. > Hotmail's RTBL was a bit agressive and needed to be adjusted. Mailman for the rxtx mail-list disabled the accounts when the mail bounced. The issue has been resolved and hotmail accounts are no longer being disabled here. -- Trent Jarvi tjarvi at qbang.org From andy at triera.net Tue Mar 18 15:48:57 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 22:48:57 +0100 Subject: [Rxtx] problem with serial communication Message-ID: <47E038C9.4080007@triera.net> Hi ! I am quite new to serial communication (in java and in general) and I have a little problem... I have established communication with my device and I am reading data from it. Problem is that reading is very slow... Device has about 500 data entries and reading takes quite a while (about 5-8 minutes)... Is there a way to speed up communication? Some time ago I found application that does the same as I do, and need only little more than a minute to read all the data... I am reading with usage of read command, character by character... and using Events.... I would be very thankful for any help... Andy From netbeans at gatworks.com Tue Mar 18 16:02:40 2008 From: netbeans at gatworks.com (U. George) Date: Tue, 18 Mar 2008 18:02:40 -0400 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E038C9.4080007@triera.net> References: <47E038C9.4080007@triera.net> Message-ID: <47E03C00.4050701@gatworks.com> Serial ports have transmit speed and receive speed settings. Setting the speed to 300baud, is about 30 characters a second, or 1800 characters a min. What is your speed setting? Andy Rozman wrote: > Hi ! > > I am quite new to serial communication (in java and in general) and I > have a little problem... I have established communication with my device > and I am reading data from it. Problem is that reading is very slow... > Device has about 500 data entries and reading takes quite a while (about > 5-8 minutes)... Is there a way to speed up communication? > > Some time ago I found application that does the same as I do, and need > only little more than a minute to read all the data... > > I am reading with usage of read command, character by character... and > using Events.... > > I would be very thankful for any help... > > Andy > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > From Noel.Goldsmith at dsto.defence.gov.au Tue Mar 18 16:34:39 2008 From: Noel.Goldsmith at dsto.defence.gov.au (Goldsmith, Noel) Date: Wed, 19 Mar 2008 09:34:39 +1100 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. Message-ID: Hi, I have just been having fun..... Installed Leopard on a MacPro with dual quad Xeons. Installed 10.5.2. Installed RXTX using the Tiger installer (2.1.7-r2). created the lock directory and the uucp directory and set the permissions. Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan USA28xB. Ran our plug-ins on ImageJ which talk serial to some devices. It all worked fine. Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro over Tiger 10.4.11, and repeated the above steps. And I get the error message that the port (USA28Xb1P1.1 ) (or whichever one I was looking for- our software is configured to look for the appropriate port name obtained from the Keyspan serial assistant.) Could not be found The same procedure works fine on the same and any number of other G5's running Tiger. What am I missing here? Thank you Noel -- Noel Goldsmith DSTO 506 Lorimer Street Port Melbourne Victoria Australia 3207 Phone 613 96267527 Mobile 0428364003 Fax 613 96267718 Email noel.goldsmith at dsto.defence.gov.au IMPORTANT: This email remains the property of the Australian Defence Organisation and is subject to the jurisdiction of section 70 of the CRIMES ACT 1914. If you have received this email in error, you are requested to contact the sender and delete the email. From andy at triera.net Tue Mar 18 16:57:31 2008 From: andy at triera.net (Andy Rozman) Date: Tue, 18 Mar 2008 23:57:31 +0100 Subject: [Rxtx] problem with serial communication In-Reply-To: <47E0471A.4040903@gatworks.com> References: <47E038C9.4080007@triera.net> <47E03C00.4050701@gatworks.com> <47E04160.6090707@triera.net> <47E04426.7060509@gatworks.com> <47E0464E.3080305@triera.net> <47E0471A.4040903@gatworks.com> Message-ID: <47E048DB.8040307@triera.net> Hi ! I have solved the problem... The problem was that I was using events, and it takes some time that event is thrown and then processed... After I started reading directly speed was fast (like with that other application I was talking about)... This happens when newbies come to town (I am not Java newbie, only Comm API newbie). Andy From ajmas at sympatico.ca Tue Mar 18 17:05:04 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Tue, 18 Mar 2008 19:05:04 -0400 Subject: [Rxtx] : RE RXTX 2.1_7 r2, Leopard, G5 and CoreTwo Duo. In-Reply-To: References: Message-ID: <00FCC9D5-C71A-4833-9484-A0311AB2E795@sympatico.ca> On 18-Mar-08, at 18:34 , Goldsmith, Noel wrote: > Hi, > I have just been having fun..... > Installed Leopard on a MacPro with dual quad Xeons. > Installed 10.5.2. > Installed RXTX using the Tiger installer (2.1.7-r2). > created the lock directory and the uucp directory and set the > permissions. > Installed the Keyspan USB/serial (version 2.5 installer) for a keyspan > USA28xB. > > Ran our plug-ins on ImageJ which talk serial to some devices. > It all worked fine. > > Then I installed Leopard (Archive and Install ) on a Dual G5 Macpro > over > Tiger 10.4.11, and repeated the above steps. > And I get the error message that the port (USA28Xb1P1.1 ) (or > whichever one > I was looking for- our software is configured to look for the > appropriate > port name obtained from the Keyspan serial assistant.) > Could not be found > > The same procedure works fine on the same and any number of other G5's > running Tiger. Not sure, but a few questions: - does the device exist in /dev? - did you reinstall RxTx? - does trying the latest source from CVS make a difference? Ande From paolopagano at hotmail.it Wed Mar 19 04:59:15 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Wed, 19 Mar 2008 10:59:15 +0000 Subject: [Rxtx] Parallel Port code Message-ID: Hi, I need reading data from parallel port where is connected a DRDAQ data logger (it contains brightness sensor and microphone). I use rxtx library and I write a program but the output is: Ho letto dalla periferica LPT1 : null I don'understand what is wrong. I use a dyagnostic program PICOLOG by which I get db values (for microphine) and lux values (for brightness sensor) so I am sure that paralell port sends data to pc. I'd like getting these values using Java so I need opening a parallel port and receiving data from data logger. Can you help me??What is incorrect??Could you suggest me anything to resolve my problem?? Thank you very much. public class test { public static void listPorts() { try{ Enumeration thePorts = gnu.io.CommPortIdentifier.getPortIdentifiers(); while (thePorts.hasMoreElements()) { gnu.io.CommPortIdentifier com = (gnu.io.CommPortIdentifier) thePorts.nextElement(); switch (com.getPortType()) { case gnu.io.CommPortIdentifier.PORT_SERIAL: try { gnu.io.CommPort thePort = com.open("CommUtil", 5000); System.out.println("Porta seriale: "+thePort.getName()); thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta SERIALE "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } case gnu.io.CommPortIdentifier.PORT_PARALLEL: try { gnu.io.CommPort thePort = com.open("CommUtil", 50); System.out.println("Porta parallela: "+thePort.getName()); ParallelPort porta = (ParallelPort)thePort; porta.setMode(ParallelPort.LPT_MODE_ANY); BufferedReader is = null; int db = 0; int av=0; String temp=null; try { is = new BufferedReader(new InputStreamReader(porta.getInputStream())); temp = is.readLine(); System.out.println("Ho letto dalla periferica "+porta.getName()+ " : "+temp); } catch (IOException e) { System.err.println("Can't open input stream: write-only"); System.out.println (e); is = null; } if (is != null) is.close(); if (thePort != null) thePort.close(); } catch(Exception e) { System.out.println("Errore durante la comunicazione con la porta: "+e); } //} thePort.close(); } catch (gnu.io.PortInUseException e) { System.out.println("Porta "+com.getName()+", ? in uso."); } catch (Exception e) { System.out.println("Failed to open port "+com.getName()+" "+e); } } } } catch(Exception ioe){ System.out.println("Errore"); } } public static void main(String[] args){ listPorts(); } } _________________________________________________________________ Scarica GRATIS la versione personalizzata MSN di Internet Explorer 7! http://optimizedie7.msn.com/default.aspx?mkt=it-it -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/e9b5ed2a/attachment-0055.html From netbeans at gatworks.com Wed Mar 19 05:22:40 2008 From: netbeans at gatworks.com (U. George) Date: Wed, 19 Mar 2008 07:22:40 -0400 Subject: [Rxtx] Parallel Port code In-Reply-To: References: Message-ID: <47E0F780.90901@gatworks.com> May I suggest removing the BufferedReader(). Just to see if you can read in a simpler way. > is = *new* BufferedReader(*new* InputStreamReader(porta.getInputStream())); > > temp = is.readLine(); > > System./out/.println("Ho letto dalla periferica "+porta.getName()+ " : > "+temp); From slacorte at ozengineering.com Wed Mar 19 18:12:58 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Wed, 19 Mar 2008 17:12:58 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080319/8f3db613/attachment-0054.html From ajmas at sympatico.ca Wed Mar 19 19:39:48 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 19 Mar 2008 21:39:48 -0400 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <161C82C4-3767-4D37-827F-68555C0A8485@sympatico.ca> I don't have one I can point you to, but have your tried compiling the source version from CVS? Andre On 19-Mar-08, at 20:12 , Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that > has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it > keeps panicking and throwing SIGSEGV or SIGBUS. > > Thanks, > > Steve > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From tjarvi at qbang.org Wed Mar 19 20:21:04 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 19 Mar 2008 20:21:04 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org From slacorte at ozengineering.com Thu Mar 20 15:46:56 2008 From: slacorte at ozengineering.com (Steven La Corte) Date: Thu, 20 Mar 2008 14:46:56 -0700 (PDT) Subject: [Rxtx] Solaris 9 built version Message-ID: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. ----- Original Message ---- From: Trent Jarvi To: Steven La Corte Cc: rxtx at qbang.org Sent: Wednesday, March 19, 2008 7:21:04 PM Subject: Re: [Rxtx] Solaris 9 built version On Wed, 19 Mar 2008, Steven La Corte wrote: > Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. > > I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. > Hi Steve, I think Sol9 was on at least 4 different CPUs. Which one are you interested in? -- Trent Jarvi tjarvi at qbang.org -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080320/f48b746f/attachment-0053.html From tjarvi at qbang.org Thu Mar 20 16:46:18 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 20 Mar 2008 16:46:18 -0600 (MDT) Subject: [Rxtx] Solaris 9 built version In-Reply-To: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> References: <672420.83824.qm@web405.biz.mail.mud.yahoo.com> Message-ID: Hi Steven, As far as I know, the binaries in r2 should work with 32 bit sparc. http://rxtx.qbang.org/pub/rxtx/rxtx-2.1-7-bins-r2.zip If they are not working, you may want to compile them on that machine. I may have compiled the distributed version on a sol 2.6 machine to avoid linkage errors on older systems. On Thu, 20 Mar 2008, Steven La Corte wrote: > I would like to try a Solaris 9 version on a sparc V220. The server has 32 bit java 1.5 installed. If someone could share, it would be appreciated. > > > ----- Original Message ---- > From: Trent Jarvi > To: Steven La Corte > Cc: rxtx at qbang.org > Sent: Wednesday, March 19, 2008 7:21:04 PM > Subject: Re: [Rxtx] Solaris 9 built version > > On Wed, 19 Mar 2008, Steven La Corte wrote: > >> Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. >> >> I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. >> > > Hi Steve, > > I think Sol9 was on at least 4 different CPUs. Which one are you > interested in? > > -- > Trent Jarvi > tjarvi at qbang.org > > > > From paolopagano at hotmail.it Fri Mar 21 06:31:02 2008 From: paolopagano at hotmail.it (paolo pagano) Date: Fri, 21 Mar 2008 12:31:02 +0000 Subject: [Rxtx] Parallel Port Message-ID: Hi all, this is a program to read from a parallel port but it doesn't work. I debugged the programm and went it arrives at * (the istruction is written in red) it generates an exception : java.lang.NullPointerException and the programm terminates without reading any value. I visited many sites and forums where many people meet the problem about "Reading from a parallel port (not writing!!!) where it is connected a device (not a printer)" but it seems nobody is able resolving it (I still don't find any useful program). So if someone can give me any suggestions I think we could help many others. - What can I do to obtain reading values from a parallel port?? - I already proved different programs but nothing. I begin thinking it isn't possible with rxtx reading from a parallel port. Isn't it?? - Have you got any source code to be succesfully tested? - Is the problem due to the specific device?? Thank you. Regardings import gnu.io.*;//import javax.comm.*;import java.io.BufferedReader;import java.io.DataInputStream;import java.io.IOException;import java.io.InputStream;import java.io.InputStreamReader;import java.io.OutputStream; public class parallelListener implements ParallelPortEventListener,Runnable{ private static InputStream outputStream;; private static ParallelPort parallelPort; private static CommPortIdentifier port; // InputStream inputStream = parallelPort.getInputStream(); // CONSTANTS public static final String PARALLEL_PORT = "LPT1"; Thread parThrd; boolean bool; byte[] array= new byte[10]; int temp=0; String string= null; public parallelListener() { try { port = CommPortIdentifier.getPortIdentifier(PARALLEL_PORT); parallelPort = (ParallelPort) port.open("CommTest", 500); System.out.println(port); System.out.println(parallelPort); parallelPort.addEventListener(this); parallelPort.notifyOnError(true); parallelPort.notifyOnBuffer(true); } catch (NoSuchPortException nspe) { System.out.println("LPT3 not found "); } catch (PortInUseException piue) { System.out.println("LPT3 is in use"); } catch (Exception e) { System.out.println("Failed to open LPT3"); } parThrd = new Thread(this); parThrd.start(); } public void run(){ try{ Thread.sleep(500); System.out.println("Program running"); // is = DataInputStream(); parallelPort.setMode(ParallelPort.LPT_MODE_ANY); //BufferedReader is = new BufferedReader(new InputStreamReader(parallelPort.getInputStream())); * DataInputStream is = new DataInputStream( (new InputStreamReader(parallelPort.getInputStream()); temp= is.read();(parallelPort.getInputStream())); //temp = is.readLine(); System.out.println("Ho letto dalla periferica "+parallelPort.getName()+ " : "+temp); }catch(Exception e){ System.out.println(e); } } public static void main(String[] args) { System.out.println("Started test...."); new parallelListener(); } public void parallelEvent(ParallelPortEvent ev) { System.out.println("ParallelPortEvent Handler"); System.out.println("Get Event. Type : " + ev.getEventType()); switch(ev.getEventType()){ case ParallelPortEvent.PAR_EV_ERROR: System.out.println("ParallelPortEvent.PAR_EV_ERROR"); System.out.println("Get Event. Type : " + ev.getEventType()); break; case ParallelPortEvent.PAR_EV_BUFFER: System.out.println("ParallelPortEvent.PAR_EV_BUFFER"); System.out.println("ParallelPortEvent.getOldValue() "); break; } } } _________________________________________________________________ Scarica GRATIS pi? di 100 emoticon per Messenger http://intrattenimento.it.msn.com/emoticon -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080321/85d54087/attachment-0053.html From Martin.Oberhuber at windriver.com Sat Mar 22 03:38:54 2008 From: Martin.Oberhuber at windriver.com (Oberhuber, Martin) Date: Sat, 22 Mar 2008 10:38:54 +0100 Subject: [Rxtx] Solaris 9 built version In-Reply-To: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> References: <860240.6461.qm@web406.biz.mail.mud.yahoo.com> Message-ID: <460801A4097E3D4CA04CC64EE648584804F28D55@ism-mail03.corp.ad.wrs.com> Hi Steven, this could be because (at least some) librxtx_serial.so libs are built with gcc -shared so they cannot run without libgcc_s.so -- see http://bugzilla.qbang.org/show_bug.cgi?id=73 If you're talking about Solaris-SPARC32, you can try the lib from the Eclipse bundle: http://rxtx.qbang.org/eclipse/downloads/ I built this on Solaris 7, and we've been using it commercially on Solaris 9 and Solaris 10 successfully. Get the RXTX-SDK*.zip download and extract it, the Solaris Lib will be in the plugins/gnu.io.rxtx.sparc.solaris fragment. Note that this lib has been built with Lockfiles disabled. More Build info: OS Version: SunOS moon 5.7 Generic_106541-08 sun4u sparc SUNW,UltraAX-MP Compiler version: gcc-3.4.5 Compiler config: configure --with-dwarf2 --disable-shared build script: ------------- #!/bin/sh setenv PATH $TOOLSRV/gcc/3.4.5/SunOS/5.7/bin:$TOOLSRV/jdk/1.4.1/SunOS/5.7/bin:$PATH cd rxtx-2.1-7r2 mkdir build-sol7 cd build-sol7 ../configure --disable-lockfiles make cp sparc-sun-solaris2.7/.libs/librxtxSerial.so $OUTDIR Cheers, -- Martin Oberhuber, Senior Member of Technical Staff, Wind River Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf Of Steven La Corte Sent: Mittwoch, 19. M?rz 2008 17:13 To: rxtx at qbang.org Subject: [Rxtx] Solaris 9 built version Can anyone refer me to a downloadable copy of librxtxSerial.so that has been tested and is known to run on a Solaris 9 server. I have tried the Solaris version from the download library and it keeps panicking and throwing SIGSEGV or SIGBUS. Thanks, Steve -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080322/e71d64a8/attachment-0052.html From r.vanballegooijen at m3holding.nl Wed Mar 26 07:40:51 2008 From: r.vanballegooijen at m3holding.nl (Rik van Ballegooijen) Date: Wed, 26 Mar 2008 14:40:51 +0100 Subject: [Rxtx] rxtx and sun ray Message-ID: <47EA5263.4040208@m3holding.nl> Hey all, Browsing the archives a bit i was unable to find any information regarding the use of rxtx with SunRay thin clients. We've been using the SUN comm implementation for some years now, but prefer to have one (supported) solution for all operating systems. Could anyone point me to a source of information regarding the use of rxtx with SunRay's? Or if this turns out to be impossible, is there a way of deciding which driver to use during runtime? I know using javax.comm.properties works, but can the driver be changed during runtime? Regards, -- Rik van Ballegooijen From greg.johnson at manchester.ac.uk Sat Mar 29 11:52:05 2008 From: greg.johnson at manchester.ac.uk (Greg Johnson) Date: Sat, 29 Mar 2008 18:52:05 +0100 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> Message-ID: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> > > Hi folks, > I've not been able to conclude from the various comments over the > past few months whether the removal of a USB dongle providing a > serial port is now handled or not - could someone give me a clue? > Certainly in the 2.1-7 (CVS, not release) that I use from about 6 > months ago, this action crashes my entire application (OSX 10.5.2, > JVM 1.5). > > Thanks for the advice, > greg > ------------------------------------------------------------------------- > Greg Johnson > Research Fellow at University of Manchester > Scientific Collaborator at ESRF - European Synchrotron > greg.johnson at esrf.fr > greg.johnson at ieee.org > +33 (0)4 76 88 28 37 > > From netbeans at gatworks.com Sat Mar 29 12:44:51 2008 From: netbeans at gatworks.com (U. George) Date: Sat, 29 Mar 2008 14:44:51 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> Message-ID: <47EE8E23.1080307@gatworks.com> the clue would be no. I had posted some patches for such USB disconnects, but so far, my impression, is that it wont be included in *THIS* ( or next ) major release. Greg Johnson wrote: >> Hi folks, >> I've not been able to conclude from the various comments over the >> past few months whether the removal of a USB dongle providing a >> serial port is now handled or not - could someone give me a clue? >> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >> months ago, this action crashes my entire application (OSX 10.5.2, >> JVM 1.5). >> >> Thanks for the advice, >> greg >> ------------------------------------------------------------------------- >> Greg Johnson >> Research Fellow at University of Manchester >> Scientific Collaborator at ESRF - European Synchrotron >> greg.johnson at esrf.fr >> greg.johnson at ieee.org >> +33 (0)4 76 88 28 37 >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > > > From tjarvi at qbang.org Sun Mar 30 16:17:52 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 30 Mar 2008 16:17:52 -0600 (MDT) Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: <47EE8E23.1080307@gatworks.com> References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: Hi George, Perhaps I'm forgetting a patch. There is the patch for concurrency which impacts performance of bitbanging. There was a larger patch in the beginning that was not broken into single concepts. Could you remind me what the USB disconnect patch was? On Sat, 29 Mar 2008, U. George wrote: > the clue would be no. > > I had posted some patches for such USB disconnects, but so far, my > impression, is that it wont be included in *THIS* ( or next ) major release. > > Greg Johnson wrote: >>> Hi folks, >>> I've not been able to conclude from the various comments over the >>> past few months whether the removal of a USB dongle providing a >>> serial port is now handled or not - could someone give me a clue? >>> Certainly in the 2.1-7 (CVS, not release) that I use from about 6 >>> months ago, this action crashes my entire application (OSX 10.5.2, >>> JVM 1.5). >>> >>> Thanks for the advice, >>> greg >>> ------------------------------------------------------------------------- >>> Greg Johnson >>> Research Fellow at University of Manchester >>> Scientific Collaborator at ESRF - European Synchrotron >>> greg.johnson at esrf.fr >>> greg.johnson at ieee.org >>> +33 (0)4 76 88 28 37 >>> >>> >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> >> >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From netbeans at gatworks.com Sun Mar 30 16:56:31 2008 From: netbeans at gatworks.com (U. George) Date: Sun, 30 Mar 2008 18:56:31 -0400 Subject: [Rxtx] Fwd: Disconnect of USB serial dongle? In-Reply-To: References: <910909EA-A17E-4065-9EAD-E171229F914B@esrf.fr> <28F6FF63-594F-419B-8234-D611A8AC14FF@manchester.ac.uk> <47EE8E23.1080307@gatworks.com> Message-ID: <47F01A9F.801@gatworks.com> I think that *THE BIG PATCH* sorta fixed 2 major things, and included a bit of errno handling. The pulling of the plug USB caused a lot, if not all system calls to fail at errno level. On Linux, there is no recovery from a pulled USB cable ( other than closing the channel, which also causes the /dev/ttyUSBx to also disappear ). I do not remember details of what specifically needs to be fixed, other than a good start at properly handling errno. I made no changes to .java sources. All alterations was made to the 'C' routines. I have not tested on windoz. Trent Jarvi wrote: > > Hi George, > > Perhaps I'm forgetting a patch. There is the patch for concurrency > which impacts performance of bitbanging. I'd still like to see proof of this ( ie removal of spin locks causes a decrease in performance.) Its not something I would expect. There was a larger patch in > the beginning that was not broken into single concepts. > > Could you remind me what the USB disconnect patch was? > > From boesi.josi at gmx.net Sun Mar 2 02:32:35 2008 From: boesi.josi at gmx.net (=?ISO-8859-15?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 10:32:35 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 Message-ID: <47CA7433.8060606@gmx.net> Hi I have a device for attaching up to 50 keypads to a computer. The connection to the PC is done over a RS232 interface. This device sends a simple string: A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud If I attach the device directly to the PC (no USB-Converter used), then 'in.read' reads one byte after the other - EACH call of 'read' returns one byte of the string - I've tested it over 4 hours. But in the real world I've to use an USB-Converter, at the moment I have one with a PL2303-Chip from Prolific. When I start my Java software with the converter, it works normally. But after some time (10-30 minutes) 'read' returns strange values: 1. really, really often -1 is returned 2. one of YZZ<10><13> is returned, although it didn't receive all 50 bytes - ie. it missed some bytes - but strangely enough it misses always exact 9 bytes - when it receives a Y, it's always at position 42, Z at position 43 or 44 and so on. 3. sometimes (but only rarely) 0 is returned Problem 1 isn't related to Problem 2. That wouldn't matter at all, if the problems wouldn't accumulate. Then I don't receive a whole string for up to 30 successive turns - no key press is recognized for more than 5 seconds. Do I have a chance to use an USB-converter in a stable way? cu boesi - thanks for your help in advance PS: Today I got a new version of the device - it sends 9.2 strings/s - directly attached no problem, but with the USB-converter it doesn't work at all. Tutty also doesn't receive anything. Is here the solution to the problem? Are 267 bytes/s (with the slow device) just too much? PPS: At first XP seems more stable than Vista, but in fact it is not. PPPS: If desired I can share some of my code. -- No matter where you are. Everyone is always connected. From drvdijk at gmail.com Sun Mar 2 03:50:24 2008 From: drvdijk at gmail.com (Daan van Dijk) Date: Sun, 2 Mar 2008 11:50:24 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Hi read() returns -1 if the end of stream has been reached, according to the Java API. Can you receive other data through the input stream after reading an -1? This might be a stupid question, but does the USB device have different settings concerning the serial port? And how do other devices react to the USB serial port? Does their data get corrupted as well? Good luck! Daan On Sun, Mar 2, 2008 at 10:32 AM, Alexander 'boesi' B?secke < boesi.josi at gmx.net> wrote: > Hi > > I have a device for attaching up to 50 keypads to a computer. The > connection to the PC is done over a RS232 interface. This device sends a > simple string: > A<50 bytes - each representing a keypad>YZZ<10><13> - 5.2 strings/s. > > some more system specs: Vista or XP, Java 1.6, RXTX-2.1-7, 9600 Baud > > If I attach the device directly to the PC (no USB-Converter used), then > 'in.read' reads one byte after the other - EACH call of 'read' returns > one byte of the string - I've tested it over 4 hours. > > But in the real world I've to use an USB-Converter, at the moment I have > one with a PL2303-Chip from Prolific. When I start my Java software with > the converter, it works normally. But after some time (10-30 minutes) > 'read' returns strange values: > 1. really, really often -1 is returned > 2. one of YZZ<10><13> is returned, although it didn't receive all 50 > bytes - ie. it missed some bytes - but strangely enough it misses always > exact 9 bytes - when it receives a Y, it's always at position 42, Z at > position 43 or 44 and so on. > 3. sometimes (but only rarely) 0 is returned > > Problem 1 isn't related to Problem 2. > > That wouldn't matter at all, if the problems wouldn't accumulate. Then I > don't receive a whole string for up to 30 successive turns - no key > press is recognized for more than 5 seconds. > > Do I have a chance to use an USB-converter in a stable way? > > > cu boesi - thanks for your help in advance > > > PS: Today I got a new version of the device - it sends 9.2 strings/s - > directly attached no problem, but with the USB-converter it doesn't work > at all. Tutty also doesn't receive anything. Is here the solution to the > problem? Are 267 bytes/s (with the slow device) just too much? > > PPS: At first XP seems more stable than Vista, but in fact it is not. > > PPPS: If desired I can share some of my code. > > -- > No matter where you are. > Everyone is always connected. > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mailman.qbang.org/pipermail/rxtx/attachments/20080302/a070d546/attachment-0073.html From boesi.josi at gmx.net Sun Mar 2 05:40:27 2008 From: boesi.josi at gmx.net (=?ISO-8859-1?Q?Alexander_=27boesi=27_B=F6secke?=) Date: Sun, 02 Mar 2008 13:40:27 +0100 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> References: <47CA7433.8060606@gmx.net> <932eca9f0803020250j5103f8b8me8def127dd1cd039@mail.gmail.com> Message-ID: <47CAA03B.5040806@gmx.net> Hi > read() returns -1 if the end of stream has been reached, according to > the Java API. Can you receive other data through the input stream after > reading an -1? Short Answer: Yes Long Answer: In the current test run in 140 minutes I've received over 41000 Strings and -1 was returned over 91000 times. But this time only once 0 was returned and no other errors occurred up to now. I just ignore this -1 and read the next byte. Error 2 in the list from my previous mail is the real annoying one, but its incidence isn't really predictable. > This might be a stupid question, but does the USB device have different > settings concerning the serial port? The port is always configured with 9600 baud, 8 data-bits, 1 stop-bit and no parity. Flow-control isn't used - I know it under the name "3-wire-handshake". > And how do other devices react to the USB serial port? Does their data > get corrupted as well? Well at the moment I have no other device with a serial port - so I don't know ... > Good luck! Daan Thanks :) cu boesi -- Wenn de L?ch net waer un dr Neid g?bs lauter gl?ckliche Leid Uhne L?ch un Neid = ganz gewi? w?r uf dr Ard is Paradies From tjarvi at qbang.org Sun Mar 2 13:29:44 2008 From: tjarvi at qbang.org (Trent Jarvi) Date: Sun, 2 Mar 2008 13:29:44 -0700 (MST) Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: <47CA7433.8060606@gmx.net> References: <47CA7433.8060606@gmx.net> Message-ID: > Do I have a chance to use an USB-converter in a stable way? To be honest, no. USB-converters vary too much to make a blanket statement such as that. I'm sure their hardware is fine and almost all fall into two chipsets. But ever device comes with a CD/driver/... Often you will not be able to figure out who wrote the driver. Some brands have better drivers. Some behave very well. Usually, if you recognize the name brand, the driver is OK. Try Keyspan, IOGear, ... they should behave well and may even listen to bug reports. If you are trying a generic solution with the driver outsourced, good luck. I doubt it is the chipset that is the problem in the end. I think it would be reasonable for rxtx.org to start a blacklist of products not supported if there are specific examples of why, we reported it to the vendor and followed up with testing when asked. -- Trent Jarvi tjarvi at qbang.org From ajmas at sympatico.ca Sun Mar 2 16:00:07 2008 From: ajmas at sympatico.ca (Andre-John Mas) Date: Sun, 2 Mar 2008 18:00:07 -0500 Subject: [Rxtx] RS232 Communication over a PL2303 In-Reply-To: References: <47CA7433.8060606@gmx.net> Message-ID: Hi, If there is any way to reproduce your observations outside of rxtx, then you could use that to file a bug request with Prolific. In fact, have you tried the driver provided on Prolific's web site, as opposed to the one bundled with the device? On the Mac is there is an open source implementation of the driver, which is not the same one as provided by the manufacturer: http://sourceforge.net/projects/osx-pl2303/ But I know nothing equivalent for Windows. Andre On 2-Mar-08, at 15:29 , Trent Jarvi wrote: >> Do I have a chance to use an USB-converter in a stable way? > > To be honest, no. USB-converters vary too much to make a blanket > statement such as that. I'm sure their hardware is fine and almost > all > fall into two chipsets. But ever device comes with a CD/driver/... > Often > you will not be able to figure out who wrote the driver. > > Some brands have better drivers. Some behave very well. Usually, > if you > recognize the name brand, the driver is OK. > > Try Keyspan, IOGear, ... they should behave well and may even listen > to > bug reports. If you are trying a generic solution with the driver > outsourced, good luck. I doubt it is the chipset that is the > problem in > the end. > > I think it would be reasonable for rxtx.org to start a blacklist of > products not supported if there are specific examples of why, we > reported > it to the vendor and followed up with testing when asked. > > -- > Trent Jarvi > tjarvi at qbang.org > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx From Ryan_Buckley1 at student.uml.edu Sun Mar 2 16:44:51 2008 From: Ryan_Buckley1 at student.uml.edu (Buckley1, Ryan M) Date: Sun, 2 Mar 2008 18:44:51 -0500 Subject: [Rxtx] RXTX on ubuntu 7.10 Message-ID: <709C6AAF0E60AC4A9A7EF7FC077E1410389453@UMLSTIS01.student.uml.edu> Hello, I'm attempting to get the rxtx comm stuff to work on ubuntu 7.10 using java 6. All I am attempting to do right now is to run a simple java application that will list the available serial ports. I've followed the instructions on http://wass.homelinux.net/howtos/Comm_How-To.shtml and I am able to compile the application. However, when I run the application in Eclipse I get the following output, 0 -1209210440 RXTX WARNING: This library requires the user running applications to be in group uucp. Please consult the INSTALL documentation. More information is avaiable under the topic 'How can I use Lock Files with rxtx?' check_lock_status: No permission to create lock file. please see