From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ? I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. ?When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. Second Problem: ?"Port In Use" exception when running SimpleWrite program. ?I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. ?I used sudo chmod 777 /var/lock to set the permission. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ajmas at sympatico.ca Wed May 18 14:05:07 2011 From: ajmas at sympatico.ca (Andre-John Mas) Date: Wed, 18 May 2011 16:05:07 -0400 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> References: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 18-May-2011, at 13:59, Garner wrote: > > > I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. Thank you for RXTX! > > I had two installations problems with installation. > > First Problem: I could not find librxtxSerial.jnilib after running make. I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... I changed that line to JAVAINCLUDEDIR = /System/Library/Frameworks/JavaVM.framework/Headers. When I ran make with that one change to the makefile, I found librxtxSerial.jnilib in the directory corresponding to my system's unix name. > > Second Problem: "Port In Use" exception when running SimpleWrite program. I fixed this problem by making sure that I had the directory /var/lock and the permission was set to 777. I used sudo chmod 777 /var/lock to set the permission. Please use the code in CVS, since this has a few MacOS X fixes applied, such as not requiring the lock directory. Give that a go and let us know how you fair. Andre From Kustaa.Nyholm at planmeca.com Thu May 19 00:17:39 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 19 May 2011 09:17:39 +0300 Subject: [Rxtx] Install Problems on OS X (10.6.7) In-Reply-To: <465319.70200.qm@web82203.mail.mud.yahoo.com> Message-ID: On 5/18/11 20:59, "Garner" wrote: >I never believed that I would see the day when I can use Java on a Mac os >x >and control an USB serial device. You might want to take a look at purejavacomm, the story here: http://www.sparetimelabs.com/purejavacomm/index.html and the code here: https://github.com/nyholku/purejavacomm br Kusti From jmg at seirad.com Sat May 21 21:12:20 2011 From: jmg at seirad.com (Joe Gatewood) Date: Sat, 21 May 2011 21:12:20 -0600 Subject: [Rxtx] force data available event Message-ID: <201105212112.20469.jmg@seirad.com> I have an application that talks to daisy chained devices. I am getting serial responses that contain a mixture of complete responses from the devices. i would like to initiate a dataavailable event after each device posts to the port. Each event would then hopefully represent a single response and reduce the parsing nightmare. Can anyone offer a suggestion? From ddevecchio at celestron.com Mon May 30 16:04:46 2011 From: ddevecchio at celestron.com (DERIK DEVECCHIO) Date: Mon, 30 May 2011 15:04:46 -0700 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled Message-ID: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ >From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? From bartley at cmu.edu Mon May 30 20:03:18 2011 From: bartley at cmu.edu (Chris Bartley) Date: Mon, 30 May 2011 22:03:18 -0400 Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: <52A60769-4787-4F73-B8AB-AC620768AE02@cmu.edu> I have updated binaries and build instructions here: http://code.google.com/p/create-lab-commons/source/browse/#svn%2Ftrunk%2Fjava%2Flib%2Frxtx I made a few small modifications, but they're all detailed in the README. Chris On May 30, 2011, at 6:04 PM, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > > From what he says it is a lot harder than downloading the sources and typing 'make'. He provides detailed instructions and also a copy of his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or work of this kind) onto the main rxtx website? I downloaded the latest CVS build and the copy of librxtxserial.jnilib there was just as old as the on on the website. For that matter, the main rxtx website seems to be distributing binaries that, 2.1.7 that haven't changed in many years. This lead me to believe that this entire project was dead. Does the rxtx library still evolve? or is it mostly static now? > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Mon May 30 19:58:53 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Mon, 30 May 2011 19:58:53 -0600 (MDT) Subject: [Rxtx] Does librxtxSerial.jnilib need to be recompiled In-Reply-To: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> References: <9FAD7E5EBDD14B4981E81E66FA62E5C732B14725@NUBULA-VM2.home.celestron.com> Message-ID: On Mon, 30 May 2011, DERIK DEVECCHIO wrote: > I was unable to get my program (which worked fine under windows) to work with my Mac (running Snow leopard 10.6). I did a little web research and found a page by Robert Harder that suggested that the native code portion of of the RxTx library for the Mac, may have been compiled only for versions of the MacOSX 10.4 and below. And that to get it to work on Snow Leopard, I would need to recompile that binary. I provide that link below. > http://blog.iharder.net/2009/08/18/rxtx-java-6-and-librxtxserial-jnilib-on-intel-mac-os-x/ > >> From what he says it is a lot harder than downloading the sources and >> typing 'make'. He provides detailed instructions and also a copy of >> his resulting files. Some people have reported success with his build. > > If Mr. Harder is correct, is there any plan to integrate this work (or > work of this kind) onto the main rxtx website? I downloaded the latest > CVS build and the copy of librxtxserial.jnilib there was just as old as > the on on the website. For that matter, the main rxtx website seems to > be distributing binaries that, 2.1.7 that haven't changed in many years. > This lead me to believe that this entire project was dead. Does the > rxtx library still evolve? or is it mostly static now? > > rxtx.org typically isn't proactive with binary releases. In the Mac example, There will probably be a new mac binary compiled and available in the next month or two unless someone contibutes binaries first. I usually put something up when I get new OS versions for compiling and testing but that happens in a delayed fashion. 2.1.7 is fairly static. The prereleases on the download page are updated in a reactive timeline from the 2.1 CVS archive. There are people compiling and patching them for their needs as well. -- Trent Jarvi tjarvi at qbang.org From will.tatam at red61.com Thu May 5 12:30:52 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:30:52 +0100 Subject: [Rxtx] WebStart, rxtx, and amd64 In-Reply-To: <4DB5CDEC.2010707@gmail.com> References: <4DB5CDEC.2010707@gmail.com> Message-ID: <4DC2ECDC.6050109@red61.com> On 25/04/11 20:39, Mike Markowski wrote: > I've run into an odd problem that hopefully someone else has seen and solved. > If I use WebStart for 32-bit linux, Intel, all is well. Java Console shows me > that it arrives at the web server as os.name=Linux and os.arch=i386 and, sure > enough, the jnlp file (attached below) points it to the correct native jar. > > However, if I try the same with 64-bit linux, Java Console shows os.name=Linux > and os.arch=amd64. The bad news is that the jnlp file does not supply -any- > rxtx native lib via WebStart. The only way I can get it to work is by adding > the last linux entry that does not specify the architecture. > > I assume I'm doing something wrong but haven't figured it out yet. Thanks for > any ideas! > > Mike > > > > > RXTX > ajmas > > Java API for serial port communication > Java API for serial port communication. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx This following works for me using the sun jre -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From will.tatam at red61.com Thu May 5 12:42:01 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 19:42:01 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: <4DC2EF79.2080108@red61.com> On 12/04/11 11:27, Kustaa Nyholm wrote: > Hi List, > > I could not resist so I had to create a Pure Java implementation of > JavaComm SerialPort > with no C-code or JNI in sight! > > If you are interested, please go to my website at: > > http://www.sparetimelabs.com/ > > and select 'PureJavaComm' from the navigation on the left. > > br Kusti > > Has anyone done any comparison testing between RXTX and this new project ? Latency is where I'm most interested as RXTX is riddled with sleep() calls -- Will Tatam Systems Architect Red61 From will.tatam at red61.com Thu May 5 13:01:07 2011 From: will.tatam at red61.com (Will Tatam) Date: Thu, 05 May 2011 20:01:07 +0100 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2EF79.2080108@red61.com> References: <4DC2EF79.2080108@red61.com> Message-ID: <4DC2F3F3.8020100@red61.com> On 05/05/11 19:42, Will Tatam wrote: > On 12/04/11 11:27, Kustaa Nyholm wrote: >> Hi List, >> >> I could not resist so I had to create a Pure Java implementation of >> JavaComm SerialPort >> with no C-code or JNI in sight! >> >> If you are interested, please go to my website at: >> >> http://www.sparetimelabs.com/ >> >> and select 'PureJavaComm' from the navigation on the left. >> >> br Kusti >> >> > > Has anyone done any comparison testing between RXTX and this new > project ? > Latency is where I'm most interested as RXTX is riddled with sleep() > calls > Is the ParallelPort complete ? it appears to be missing functions like isPaperOut() and isPrinterError() -- Will Tatam Systems Architect Red61 0845 867 2203 ext 103 From Kustaa.Nyholm at planmeca.com Thu May 5 13:29:05 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Thu, 5 May 2011 22:29:05 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC2F3F3.8020100@red61.com> Message-ID: On 5/5/11 22:01, "Will Tatam" wrote: > Is the ParallelPort complete ? it appears to be missing functions like > isPaperOut() and isPrinterError() purejavacomm is strictly serial port, I've got no plans to add parallel port, though of course it would not be difficult, but I've got no hardware with parallel port. > Has anyone done any comparison testing between RXTX and this new project >? > Latency is where I'm most interested as RXTX is riddled with sleep() >calls I don't think anyone has done anything like that yet. It is early days with purejavacomm yet. At the moment basic functionality works and I've got some positive reports but also some users have identified some issues that I try to resolve in the coming weeks. I'm not sure if we are welcome to hijack rxtx list for purejavacomm discussions. I don't mind but it is not for me to say. Also, please do not cc pete batard, he might get annoyed after awhile as this really has nothing to do with him. br Kusti From tjarvi at qbang.org Thu May 5 19:56:15 2011 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 5 May 2011 19:56:15 -0600 (MDT) Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: > I'm not sure if we are welcome to hijack rxtx list for > purejavacomm discussions. I don't mind but it is not for > me to say. Hehe, Hijack? I guess that means we would lose something other than work? Posts related to CommAPI are welcome here. Really, its open to the general interest group as a whole with no expectations. -- Trent Jarvi tjarvi at qbang.org From Kustaa.Nyholm at planmeca.com Thu May 5 23:59:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 08:59:37 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: <4DC33F55.2070004@gmail.com> Message-ID: On 5/6/11 03:22, "Curtis Hacker" wrote: >Is there no common shared language structure between the OS's at this >point ? jtermios.windows/macosx/linux ? I'm not sure if I understand what you are asking? The purejavacomm.* classes are 100% shared between the OSs and contains all the functionality that implement javax.comm.* functionality in terms of, or on top of, an idealized POSIX like device API which is implemented by jtermios.JTermios class (plus the other structures in that package). Especially the purejavacomm.PureJavaSerialPort does most of the work, apart from the device enumeration which is in purejavacomm.CommPortIdentifier class. So that is all 100% shared between the OS's. JTermios defines all the necessary POSIX like API calls as static functions that delegate the actual implementation to one of the OS/arch specific implementation class instances defined in in the jtermios.*.JTermiosImpl classes. The implementing classes for POSIX -like operating systems are very thin wrappers around JNA calls to the actual Unix/Linux standard C-library calls. There is very little actual code or definitions in them and what there is cannot be shared between OS as this is the 'glue' that attaches the abstract with the concrete. For Windows, which is totally unlike unix, the implementation class jtermios.windows.JTermiosImpl contains quite a lot of code to do the impedance matching between unix and windows way of doing things. This is of course very Windows specific and cannot be shared. JTermios defines, in addition to the API functions, all the constants necessary to pass to the those functions, such as O_NONBLOCK, B19200 etc etc. The values of these constants varies between (or can vary, I have not checked every OS out there ;-) operating systems, so these cannot be defined 'final'. JTermios provides default values for these constants which the JTermiosImpl class is supposed to write over in the constructor if required. The default values are those from/for Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need to override anything. In Windows the values of these constant have no meaning so the windows.JTermiosImpl can use the mac values as-is and it does not need to change them. So at the moment only linux.JTermiosImpl needs to change those constants from the default values. Hope this clarifies. > >Non standard baud rates possible on linux and osx (10.4 or better) ? Well, the way it works is that purejavacomm.PureJavaSerialPort checks if the requested baud rate is one of the 'standard' (which standard BTW) baud rates and if so passes the OS specific constant to the next layer in the communication stack, or, if the baud rate is non standard, then the requested value directly to the next layer. In unix-like systems the next layer is basically the OS API function so it is up to the OS to decide what to do with that. In Mac OS X and Windows it turns out that the OS specific constant is actually the baud rate value so you it gets passed directly to the OS and you can use whatever the OS supports. In Linux the OS specific constants are not directly the baudrate values, for example the OS constant for 9600 baud is 15, but since the non standard values get passed directly to the OS you can use whatever the OS supports as long as you can figure out what the constant is, which you should be able to do by examining the termios.h header of your Linux. The 'standard' baud rates as far as JTermios is concerned are the standard POSIX baud rates ie 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. But if I made myself clear you above you are not limited to these, in Mac OS X I think at least 14400 and 57600 are supported and in Windows in addition to those there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the current state of affairs, but seem to recall that you can get 'weird' baud rate with special values, for example to set 230400 use 22. Hope this clarifies a bit (pun intended). br Kusti PS Since Trent was courteous enough to allow this discussion in the rxtx list I'm CC:ing the list. From damorales at gmail.com Fri May 6 07:33:19 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 09:33:19 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: <4DC33F55.2070004@gmail.com> Message-ID: Hi I'm developing an application that use rxtx to comunicate with a serial port (UART) to send commands to a PLCBUS device and it works perfect (I only tried in linux). I would like to try purejavacomm. Is all the serial port functionality ready to use ? Thanks. Greetings! 2011/5/6 Kustaa Nyholm > On 5/6/11 03:22, "Curtis Hacker" wrote: > > >Is there no common shared language structure between the OS's at this > >point ? jtermios.windows/macosx/linux ? > > > I'm not sure if I understand what you are asking? > > The purejavacomm.* classes are 100% shared between the OSs and contains > all the functionality that implement javax.comm.* functionality in terms > of, or on top of, an idealized POSIX like device API which is implemented > by jtermios.JTermios class (plus the other structures in that package). > > Especially the purejavacomm.PureJavaSerialPort does most of the work, > apart from the device enumeration which is in > purejavacomm.CommPortIdentifier > class. > > So that is all 100% shared between the OS's. > > > JTermios defines all the necessary POSIX like API calls as static functions > that delegate the actual implementation to one of the OS/arch specific > implementation class instances defined in in the jtermios.*.JTermiosImpl > classes. > > The implementing classes for POSIX -like operating systems are very thin > wrappers around JNA calls to the actual Unix/Linux standard C-library > calls. > There is very little actual code or definitions in them and what there is > cannot be shared between OS as this is the 'glue' that attaches the > abstract > with the concrete. > > For Windows, which is totally unlike unix, the implementation class > jtermios.windows.JTermiosImpl contains quite a lot of code to do the > impedance matching between unix and windows way of doing things. This is > of course very Windows specific and cannot be shared. > > JTermios defines, in addition to the API functions, all the constants > necessary to pass to the those functions, such as O_NONBLOCK, B19200 > etc etc. The values of these constants varies between (or can vary, I > have not checked every OS out there ;-) operating systems, so these > cannot be defined 'final'. JTermios provides default values for these > constants which the JTermiosImpl class is supposed to write over in the > constructor if required. The default values are those from/for > Mac OS X 10.6.6 / x86_64 so that the macosx.JTermiosImpl does not need > to override anything. In Windows the values of these constant have no > meaning so the windows.JTermiosImpl can use the mac values as-is and > it does not need to change them. So at the moment only linux.JTermiosImpl > needs to change those constants from the default values. > > > Hope this clarifies. > > > > >Non standard baud rates possible on linux and osx (10.4 or better) ? > > Well, the way it works is that purejavacomm.PureJavaSerialPort checks if > the requested baud rate is one of the 'standard' (which standard BTW) baud > rates > and if so passes the OS specific constant to the next layer in the > communication stack, or, if the baud rate is non standard, then the > requested > value directly to the next layer. In unix-like systems the next layer is > basically > the OS API function so it is up to the OS to decide what to do with that. > > In Mac OS X and Windows it turns out that the OS specific constant is > actually the baud > rate value so you it gets passed directly to the OS and you can use > whatever > the OS supports. > > In Linux the OS specific constants are not directly the > baudrate values, for example the OS constant for 9600 baud is 15, but since > the non standard values get passed directly to the OS you can use whatever > the OS supports as long as you can figure out what the constant is, which > you > should be able to do by examining the termios.h header of your Linux. > > The 'standard' baud rates as far as JTermios is concerned are the standard > POSIX baud rates ie > 50,75,110,134,150,200,300,1200,1800,2400,4800,9600,19200,38400. > > But if I made myself clear you above you are not limited to these, in Mac > OS X > I think at least 14400 and 57600 are supported and in Windows in addition > to those > there is 56000,115200,128000 and 256000. In Linux I'm not sure what is the > current > state of affairs, but seem to recall that you can get 'weird' baud rate > with special > values, for example to set 230400 use 22. > > Hope this clarifies a bit (pun intended). > > br Kusti > > PS > > Since Trent was courteous enough to allow this discussion in the rxtx list > I'm CC:ing the list. > > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 6 07:47:17 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 6 May 2011 16:47:17 +0300 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: Message-ID: On 5/6/11 16:33, "Daniel Morales Salas" wrote: >Hi > >I'm developing an application that use rxtx to comunicate with a serial >port (UART) to send commands to a PLCBUS device and it works perfect (I >only tried in linux). I would like to try purejavacomm. Is all the serial >port functionality ready to use ? Hard to say, but it definitely is ready enough to be tried! It works for some people, some people have reported some issues that I'm working with. br Kusti > From damorales at gmail.com Fri May 6 08:42:22 2011 From: damorales at gmail.com (Daniel Morales Salas) Date: Fri, 6 May 2011 10:42:22 -0400 Subject: [Rxtx] Announcing PureJavaComm In-Reply-To: References: Message-ID: Ok, I will try it this weekend and I will let you know how it goes. Thanks and greetings!! 2011/5/6 Kustaa Nyholm > On 5/6/11 16:33, "Daniel Morales Salas" wrote: > > >Hi > > > >I'm developing an application that use rxtx to comunicate with a serial > >port (UART) to send commands to a PLCBUS device and it works perfect (I > >only tried in linux). I would like to try purejavacomm. Is all the serial > >port functionality ready to use ? > > Hard to say, but it definitely is ready enough to be tried! > > It works for some people, some people have reported some issues > that I'm working with. > > br Kusti > > > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > -- Atte: Daniel Dario Morales Salas Ingeniero Civil en Computaci?n e Inform?tica Tel?fono: 02 684 3417 Celular: 09 643 1802 Santiago, Chile -------------- next part -------------- An HTML attachment was scrubbed... URL: From blueeagle2 at gmail.com Sat May 7 01:35:18 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Sat, 7 May 2011 00:35:18 -0700 Subject: [Rxtx] rxtx for eclipse in Windows XP Message-ID: I installed the eclipse plugins for rxtx, but eclipse does not recognize the import gnu.io.*; What else do I need to do? I looked for a rxtx.jar file, but could not locate one. Do eclipse plugins work differently? -------------- next part -------------- An HTML attachment was scrubbed... URL: From aawolfe at gmail.com Sat May 7 05:07:44 2011 From: aawolfe at gmail.com (Aaron Wolfe) Date: Sat, 7 May 2011 07:07:44 -0400 Subject: [Rxtx] USB latency woes Message-ID: I use RXTX in an open source project that implements a disk drive over serial emulation for old 8 bit computers, and it's been great. In the past the top rate the old computers could digest was 115k, but recently a retro-guru has hacked up a way to do 230kbps. We've found that throughput with USB adapters is poor, in some cases barely better than 115k, yet with a real serial port the gains in speed are large. It seems there is a large latency per operation on all the USB adapters we've tried, although it varies a lot from one to the next. By tweaking settings in the driver for the adapter, I've been able to improve things, but still the best USB adapter (a Prolific 2303) is about 10% slower than a real serial port, and the others are worse. The latency seems to occur per call to read() or write().. for instance if I need to read 2 bytes, it takes almost twice as long to do read(byte); read(byte) as it does a single read(byte[2]). We do a lot of small i/o back and forth, sometimes a single byte. The largest transaction is only about 260 bytes in one direction, a handful in the other. By combining as many operations into larger blocks as I can, latency can be reduced, but still it's having major effects and there are some operations that just have to send lots of tiny bits back and forth, no way to combine them. Has anybody dealt with this and improved things, or is this just life with USB->serial? There are lots of timing tweaks available in RXTX, but I've had odd results when messing with them, especially with different behavior on different platforms. I thought maybe there was some magic combination of things that would help. Thanks for any ideas -Aaron From Kustaa.Nyholm at planmeca.com Sat May 7 07:24:40 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Sat, 7 May 2011 16:24:40 +0300 Subject: [Rxtx] USB latency woes In-Reply-To: Message-ID: On 5/7/11 14:07, "Aaron Wolfe" wrote: > >Has anybody dealt with this and improved things, or is this just life >with USB->serial? My experience is that this is life with USB. USB is based on 1 ms polling (the host asks the device if it has any data once every msec) so if you read one byte it may well be that next byte is available 1 msec later. Also some adapters, atleast FTDI has 10 msec (IIRC) latency when you write anything less than an internal buffer full (64 bytes IIRC) so this really kills your throughput if you do a lot of small transfers. YMMV. br Kusti From Hans.Nouwens at xs4all.nl Sat May 7 07:47:41 2011 From: Hans.Nouwens at xs4all.nl (Hans Nouwens) Date: Sat, 7 May 2011 15:47:41 +0200 Subject: [Rxtx] USB latency woes In-Reply-To: References: Message-ID: Aaron, with the ftd chipset I use I'm able to set a legacy time-out to a minimum of 1 ms. This means that whatever amount of bytes are waiting in the buffer it sends or transmits anyway. With some overhead I'm able to communicate with my hardware with 600 messages per second. My messages are usually smaller than 20 bytes. Hans Nouwens. > I use RXTX in an open source project that implements a disk drive over > serial emulation for old 8 bit computers, and it's been great. In the > past the top rate the old computers could digest was 115k, but > recently a retro-guru has hacked up a way to do 230kbps. > > We've found that throughput with USB adapters is poor, in some cases > barely better than 115k, yet with a real serial port the gains in > speed are large. It seems there is a large latency per operation on > all the USB adapters we've tried, although it varies a lot from one to > the next. By tweaking settings in the driver for the adapter, I've > been able to improve things, but still the best USB adapter (a > Prolific 2303) is about 10% slower than a real serial port, and the > others are worse. > > The latency seems to occur per call to read() or write().. for > instance if I need to read 2 bytes, it takes almost twice as long to > do read(byte); read(byte) as it does a single read(byte[2]). We do a > lot of small i/o back and forth, sometimes a single byte. The largest > transaction is only about 260 bytes in one direction, a handful in the > other. By combining as many operations into larger blocks as I can, > latency can be reduced, but still it's having major effects and there > are some operations that just have to send lots of tiny bits back and > forth, no way to combine them. > > Has anybody dealt with this and improved things, or is this just life > with USB->serial? There are lots of timing tweaks available in RXTX, > but I've had odd results when messing with them, especially with > different behavior on different platforms. I thought maybe there was > some magic combination of things that would help. > > Thanks for any ideas > -Aaron > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From blueeagle2 at gmail.com Thu May 12 13:35:20 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Thu, 12 May 2011 12:35:20 -0700 Subject: [Rxtx] Installing RXTX on Linux Message-ID: I was wondering if someone could clear up some confusion about installing RXTX on 64-bit Ubuntu. I downloaded the package rxtx-2.1-7-bins-r2.zip and it has librxtxSerial.so in a X86_64 folder for Linux, but on the download page, it says to use the CloudHopper binaries. If the one in the file does not work, should there not be some kind of readme file to that effect. Also, can I just use the source and compile it for my 64-bit machine. I have never actually done this so I am not exactly sure how involved it is. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dwayne.hubbard at gmail.com Thu May 12 15:06:47 2011 From: dwayne.hubbard at gmail.com (Dwayne Hubbard) Date: Thu, 12 May 2011 16:06:47 -0500 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 2:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu.? I downloaded the package rxtx-2.1-7-bins-r2.zip and > it has librxtxSerial.so in a X86_64 folder for Linux, but on the download > page, it says to use the CloudHopper binaries.? If the one in the file does > not work, should there not be some kind of readme file to that effect. Not sure if I can clear up any confusion since I'm a relatively new rxtx user, but I'm using it on 64-bit Ubuntu. I did a 'cvs checkout -r commapi-0-0-1 rxtx-devel', then ./configure ; make ; make install I personally was a little confused about whether or not I was using the most stable/best branch of rxtx, but this particular checkout does what I need it to do. hope this helps, -Dwayne. From showard314 at gmail.com Thu May 12 15:11:06 2011 From: showard314 at gmail.com (Scott Howard) Date: Thu, 12 May 2011 17:11:06 -0400 Subject: [Rxtx] Installing RXTX on Linux In-Reply-To: References: Message-ID: On Thu, May 12, 2011 at 3:35 PM, wrote: > I was wondering if someone could clear up some confusion about installing > RXTX on 64-bit Ubuntu. If you just want a working rxtx, Ubuntu has an rxtx package. You can get it with "$ sudo apt-get install librxtx-java" It is natively compiled for AMD64. If you want to play around with the source code and compile it yourself it will compile on an AMD64 ubuntu machine, make sure you installed the default-jdk (or sun java's jdk) package first. I think it is pretty straight forward if you follow the directions. Cheers, Scott From blueeagle2 at gmail.com Fri May 13 01:15:17 2011 From: blueeagle2 at gmail.com (blueeagle2 at gmail.com) Date: Fri, 13 May 2011 00:15:17 -0700 Subject: [Rxtx] RXTX works -- Yea!! Message-ID: Well, I finally was able to get RXTX to work in both Windows and Linux. I used a loopback USB/RS232 serial device to test it and some Java code that I found on the Internet and modified for my use. It seems to work fine for a loopback device, but not on my UBW(Universal Bit Whacker) from SparkFun.com. But at least I know my serial problem is resolved and I did not have to use the CloudHopper Binaries. All I had to do was uninstall all my recent trials to get serial to work. I had tried rxtx and another one just called SerialPort. I think they were interfering with each other. So, I uninstalled everything and removed all the libraries and then reinstalled from the Ubuntu depository and after adding the ext jar from /usr/share/Java, it just worked though as I said before it still does not work with UBW which is the whole purpose of my trying to use serial in the first place. I guess I need to do some more research on why it is not working. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Kustaa.Nyholm at planmeca.com Fri May 13 11:28:27 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Fri, 13 May 2011 20:28:27 +0300 Subject: [Rxtx] Windows com API issue anyone? Message-ID: In my purejavacomm serial port I've run into an issue (or actually one user has): Sometimes my WaitCommEvent call reports that a byte has arrived but when I call ClearCommError and look at the input queue, it is empty. Any one seen this? Trent? Travis? I looked at the termios.c in rxtx, the serial_select in particular, and in general it looks like mine, but it does a few extra ClearCommError errors and there is a 1 msec delay before it returns when a byte has been received. Are these there needed based on experience or just in case, Windows examples don't show them. br Kusti From Kustaa.Nyholm at planmeca.com Mon May 16 05:25:37 2011 From: Kustaa.Nyholm at planmeca.com (Kustaa Nyholm) Date: Mon, 16 May 2011 14:25:37 +0300 Subject: [Rxtx] Windows com API issue anyone? In-Reply-To: Message-ID: On 5/13/11 20:28, "Kustaa Nyholm" wrote: >In my purejavacomm serial port I've run into an issue >(or actually one user has): > > >Sometimes my WaitCommEvent call reports that a byte has >arrived but when I call ClearCommError and look at the >input queue, it is empty. > >Any one seen this? > >Trent? Travis? > >I looked at the termios.c in rxtx, the serial_select in particular, >and in general it looks like mine, but it does a few extra ClearCommError >errors and there is a 1 msec delay before it returns when a byte >has been received. Are these there needed based on experience or >just in case, Windows examples don't show them. Ok, answering my own question. This was a classic problem with WaitCommEvent: if character is received while reading, WaitCommEvent may indicate that a character has arrived (which is true!) but since you are reading them away you may already have read it so it may no longer be available for reading by the time WaitCommEvent reports it. I've now worked around this. However, looking at the termios.c in rxtx looks as if it should suffer from the same problem, but since it has been used successfully for year it seems incredible that it does. I would love to understand why it does not .... ? br Kusti From frans_nieuwerth at nl.ibm.com Mon May 16 08:03:15 2011 From: frans_nieuwerth at nl.ibm.com (Frans Nieuwerth) Date: Mon, 16 May 2011 16:03:15 +0200 Subject: [Rxtx] AUTO: Frans Nieuwerth/Netherlands/IBM is out of the office until Monday (returning 23-05-2011) Message-ID: I am out of the office until 23-05-2011. I will be out of the office for a business trip until May 23, 2011. I will have access to email and voicemail but will be in a different timezone, so therefore will not able to respond swiftly. For urgent matters regarding Information Management activities, contact my manager Laurent Zeller, or the IM Sales for that opportunity. See you on the 23rd, Frans Note: This is an automated response to your message "Re: [Rxtx] Windows com API issue anyone?" sent on 16/5/11 13:25:37. This is the only notification you will receive while this person is away. From jorgenovoa8 at gmail.com Mon May 16 16:42:27 2011 From: jorgenovoa8 at gmail.com (jorge novoa) Date: Mon, 16 May 2011 22:42:27 +0000 (UTC) Subject: [Rxtx] =?utf-8?q?Invitaci=C3=B3n_a_conectarnos_en_LinkedIn?= Message-ID: <682949065.13597237.1305585747162.JavaMail.app@ela4-bed35.prod> LinkedIn ------------ Me gustar?a a?adirte a mi red profesional en LinkedIn. -jorge jorge novoa Profesional independiente en el sector Desarrollo de programaci?n Chihuahua y alrededores, M?xico Confirma que conoces a jorge novoa https://www.linkedin.com/e/-hxrr9z-gns01luf-6o/isd/2901040450/5t7PO8ws/ -- (c) 2011, LinkedIn Corporation -------------- next part -------------- An HTML attachment was scrubbed... URL: From add1g-house at yahoo.com Wed May 18 11:59:03 2011 From: add1g-house at yahoo.com (Garner) Date: Wed, 18 May 2011 10:59:03 -0700 (PDT) Subject: [Rxtx] Install Problems on OS X (10.6.7) Message-ID: <465319.70200.qm@web82203.mail.mud.yahoo.com> I never believed that I would see the day when I can use Java on a Mac os x and control an USB serial device. ?Thank you for RXTX! I had two installations problems with installation. First Problem: ?I could not find librxtxSerial.jnilib after running make. ?I notice a warning message after running configure that configure could not locate /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/../../../Headers and I need to edit JAVANATINC in the makefile. The line above JAVANATINC is JAVAINCLUDEDIR =... ?